The infected insects were found in the Pomonok neighborhood in Queens and Huguenot Beach in Staten Island, the Health Department said.
The agency has not found any human cases of the disease this year.
“Now that West Nile virus has returned to New York City, it is important to take simple precautions to protect you and your family,” Health Commissioner Dr. Thomas Farley said in a release.
“Be sure to wear mosquito repellent when outdoors, and cover your arms and legs if you’re outside at dawn or dusk."
The Health Department has increased its surveillance of mosquitoes and set up more traps for them because of the detection of the virus.
They have also started to treat catch basins in the areas and will continue to apply larvicide to kill mosquito larva in catch basins, marshlands and areas with standing water.
Not everybody who gets infected with the virus becomes ill, but it can cause flu-like symptoms including fever, headaches and fatigue, the Health Department said.