The officer, 30-year-old Brian Groves, was hit in his bullet-resistant vest on the 20th floor of the building on Essex Street just before 3:45 a.m.
He was rushed to Bellevue Hospital with a non-life threatening injury.
A large number of police officers descended on the apartment building, operated by the New York City Housing Authority.
They were searching the building for the suspect, who may have fled into a stairwell.
He was described as a man in his 20s, approximately 5-foot-9, wearing a black T-shirt and red shorts. His hair is in corn rows.
Groves and his partner were pursuing the suspect down the stairs when the man turned and fired one shot at the officer's heart. The vest saved his life. Groves returned fire, but it was unclear if the suspect was hit.
Groves has been assigned to the Housing Bureau since he joined the department in 2005. He is the father of two young daughters.
Groves was the ninth NYPD officer to be shot in the line of duty this year. Many others have been stabbed.
Doctors are examining Officer Groves to make sure his heart was not damaged. There is a bruise, but they are checking to see if there is internal damage.
WAKE UP WITH EYEWITNESS NEWS! Click here to download the WABC Eyewitness News Alarm Clock app from iTunes. or search WABC or 7online in the app store.
Get Eyewitness News Delivered