The widow of a Nassau County police officer slain last year in a friendly-fire mishap has filed suit against the officers who responded to the chaotic scene where a man earlier had run amok with a knife.

Paula Breitkopf was married to Nassau County Officer Geoffrey Breitkopf, who was shot and killed after a retired NYPD officer who responded to the scene saw him holding an assault rifle and mistook him for a suspect.

The 58-year-old retired New York City Police Emergency Service Unit cop, John Cafarella, had rushed to the Long Island scene after hearing calls about the knife incident on his police scanner back in March 2011, officials said.

Cafarella yelled, “Gun!’’ as he saw Breitkopf approaching the house.

At the time, Breitkopf was in plainclothes and was carrying an M-4 assault rifle under his arm.

An on-duty MTA officer who also had responded to the scene, Glen Gentile, fired his gun, killing Breitkopf, officials said.

Breitkopf was a married father of two and a member of the Nassau County Police Bureau of Special Operations.

The lawsuit, filed on March 6, also names the MTA as a defendant and levels accusations of negligence.

It also claims that Cafarella was “impersonating a police officer” at the time of the incident.

The tragedy began after police were called to a Massapequa home to confront Anthony DiGeronimo, a 21-year-old man who was wielding a knife, officials said.

He was shot dead after coming at cops with a knife during the March 12, 2011 incident, officials said.

Last month, the Nassau County District Attorney’s Office announced they would not press any charges in the friendly-fire incident.

“Although the results [of the case] were unquestionably tragic, criminal charges under these circumstances would be legally unsustainable,” said Nassau DA Kathleen Rice.