US media identified the victim as 51-year-old Rafael Laureano and quoted a police spokesman as saying that he was shot by mistake.
Police told AFP they were called to a Brooklyn apartment where a 47-year-old man armed with a knife was assaulting a woman and two children, aged six and seven, who were locked in the bathroom.
"After ordering the suspect to drop the knife multiple times, police discharged their firearms striking the armed individual. The 47-year-old male was pronounced dead," a police source said.
Police said the 51-year-old man, who also entered the apartment, "sustained trauma to the torso during the incident" and was pronounced dead at hospital.
More From This Section
The medical examiner's office said Laureano died from a gunshot wound to the back and declared his death a homicide.
Police said the 35-year-old woman and her children were unharmed.
Monday's incident came just over two months after a black father of six suffered a fatal heart attack after New York police officers on Staten Island used an illegal choke hold to subdue him.
On August 9, officers in Ferguson, Missouri shot dead an unarmed black teenager, sparking protests and reigniting fierce national debate about relations between police and African Americans and police tactics.