One of the suspects was seen on a surveillance video from the crime scene in the Bronx, police said. No charges have been filed.
Both officers are listed in stable condition.
The shooting occurred around 10:30 p.m. Monday in the Tremont section. The officers were coming off their shift when they and three other plainclothes officers responded to the robbery report.
"They went above and beyond the call to protect their fellow New Yorkers. Thank God the officers are doing well and will recover," Mayor Bill de Blasio said at the hospital where the officers are recovering.
The shooting came about two weeks after two officers were fatally shot while sitting in their patrol car in Brooklyn, and on the same day that the city touted record low crime levels.
Monday night's shooting unfolded as officers were searching for suspects for an armed robbery that occurred minutes earlier at a grocery store.
Police Commissioner William Bratton said the officers, part of an anti-crime unit, were in a car when they spotted two possible suspects - one outside a Chinese restaurant and another inside it.
When the officers got out, the suspect in the restaurant opened fire, forcing the officers to shoot back, Bratton said. The two suspects fled and then carjacked a white Camaro, which was later found abandoned. A revolver was recovered nearby.
The commissioner said police are reviewing video that they hope will help them identify the suspects.
The organization COP SHOT, Citizens Outraged at Police Being Shot, has offered a $10,000 reward leading to the arrest and conviction of the suspects.
The two officers were not identified. They were described as a 30-year-old who was shot in his left arm and lower back, and a 38-year-old hit in his left arm and chest.
On Dec. 20, Officers Rafael Ramos and Wenjian Liu were gunned down in their patrol car by a man who vowed online to kill "pigs." The man opened fire, then ran into a subway where he shot himself to death.
Ramos was buried Dec. 27; Liu was buried Sunday. Tens of thousands of officers from around the country attended the funerals. Many turned their backs as de Blasio spoke because some say he is anti-police.