Police said the suspect, Steven Cohen, 63, shot Queens convenience store employee Mohmediyan Tarwala, 26, in the stomach following an argument. Tarwala was rushed to a nearby hospital where he died from his injuries.
Officer Jason Maharaj, who was off-duty and inside the store at the time, chased Cohen outside and tackled him. He held the suspect until other officers arrived.
"On & off-duty, your NYPD cops put their lives on their line to protect New Yorkers — it's what they do. Outstanding work, Officer Maharaj!" NYPD Commissioner Dermot Shea tweeted after the incident.
Authorities said Cohen, who had been living in a minivan parked behind the shop, went into the store, located in Ozone Park, just after 6 p.m. and was escorted out when he couldn't pay for an item. He later returned with his gun before allegedly shooting Tarwala, NBC New York reported.
Soon after, Cohen attempted to shoot at the store clerk, who was protected by plexiglass, police said.
Surveillance video released by police showed Maharaj running at the suspect.
"The moment after a man shot & killed a deli worker, off-duty NYPD Officer Maharaj, with out regard for his own safety, tackled the shooter, disarmed him & held him for responding cops," Shea tweeted along with the released video of the incident.
He called it "nothing short of heroic."
Cohen was charged with murder, attempted murder, and criminal use of a firearm, authorities said.