It happened at Avenue A and East 7th Street, near the southwest corner of Tompkins Square Park, around 3:40 a.m. Thursday.
The NYPD says two uniformed officers were on patrol in the park when they heard gunshots and saw one man shooting at another.
The officers gave numerous commands for the shooter to get onto the ground, Chief of Department Terence Monahan said.
"He refused," Monahan said. "He kept on walking."
Officers then fired three times, fatally wounding the gunman.
WATCH: NYPD briefing on deadly police-involved shooting in East Village
Both the suspect and the man who had been shot by the suspect were taken to Bellevue Hospital, where both were pronounced dead.
Law enforcement identified the shooter as 37-year-old Earl Facey, who they say killed 41-year-old Richard Reed before being shot by the officers.
Police say both men are reputed gang members and have been linked to prior shootings.
Neither officer was injured, although they were taken to the hospital to be treated for ringing in the ears.
Police say both officers' body-worn cameras were activated during the incident. Those recordings are being reviewed as part of the investigation.
Two .22 caliber handguns were recovered at the scene, one underneath the suspect who was shot by police, the other near the victim of the earlier gunfire.
Authorities say the two men did not appear to know each other, and the shooting appears to be the result of a fight between their friends inside a hookah bar.
Both groups were ejected by the hookah bar's bouncer, and the fight continued outside.
"This morning's shooting underscores the courage our cops show each and every day as they run towards the danger," Monahan said. "Thankfully, our cops were not hurt in the incident."
Several blocks of Avenue A were shut down as the investigation continued.
* More Manhattan news
* Send us a news tip
* Download the abc7NY app for breaking news alerts
* Follow us on YouTube