The plainclothes officers were near the end of their shift on Monday night when they and three others responded to a report of a robbery at a small market.
Police say they spotted two possible suspects and one opened fire.
A 30-year-old officer was shot in his left arm and lower back and a 38-year-old was hit in his left arm and chest.
Police say one of the suspects may have been wounded in the gunfire.
They were trying to determine whether a man who later walked into a hospital with a gunshot wound to his back was connected to the shooting.
The shooting came at a time of high tension between police and communities across America.
Two weeks ago two officers were gunned down in their patrol car in Brooklyn by a man who vowed online to kill “pigs”.