He says he put his life on the line to stop a killer — and claims cops sat back and watched.

But city lawyers are arguing that the police had no legal duty to protect Joseph Lozito, the Long Island dad stabbed seven times trying to subdue madman Maksim Gelman — a courtroom maneuver the subway hero calls “disgraceful.”

A judge is currently deciding whether Lozito, who sued the city last year for failing to prevent the attack, will get his day in court.

The drug-fueled Gelman had fatally stabbed three people in Brooklyn and killed another with a car during a 28-hour rampage when he entered an uptown No. 3 train on Feb. 12, 2011.

Police officers Terrance Howell and Tamara Taylor were part of a massive NYPD manhunt. They were in the operator’s cab, watching the tracks between Penn Station and 42nd Street for any sign of the fugitive. Lozito was seated next to the cab.

In the official NYPD account and Howell’s own affidavit, Howell heroically tackled and subdued the killer. But Lozito tells a different story.

The 42-year-old mixed-martial-arts fan says he watched Gelman approach the cab window, barking: “Let me in!” Gelman even claimed to be a cop, but a dismissive Howell turned away, he says.

Gelman walked off. A straphanger recognizing Gelman tried to alert the cops, but was also rebuffed. A minute later, Gelman returned and set his sights on the 6-foot-2, 270-pound Lozito.

“You’re going to die,” Gelman announced — then stabbed him in the face.

Lozito leapt from his seat and lunged at the 23-year-old Gelman as the psycho sliced at him.

“Most of my wounds are in the back of my head,” Lozito said. “He got to the back of my head because my left shoulder [was] in his waist.”

In his account, Lozito pinned Gelman to the floor, disarming him. Howell then emerged from the booth, tapping Lozito’s shoulder: “You can get up now,” he said.

“By the time he got there, the dirty work was already done,” Lozito said.

Gelman was convicted in the spree — which left his girlfriend, her mother, his stepfather and a pedestrian dead, and five others injured.

Lozito says a grand-jury member later told him Howell admitted on the stand that he hid during the attack because he thought Gelman had a gun.

An angry Lozito decided to sue the city for negligence, arguing the cops should have recognized Gelman and prevented, or reacted more quickly to, the assault.

The city routinely settles such litigation but is playing hardball with Lozito, insisting his demand for unspecified money damages be tossed because the police had no “special duty” to protect him or any individual on the train that day.

“Under well-established law, the police are not liable for such incidents,” said city lawyer David Santoro. “That doesn’t detract from the Police Department’s public safety mission — or the fact that New York is the safest big city in America.”

Experts say it’s a long-standing legal precedent requiring police to put the public safety of all ahead of any one individual’s rights.

Lozito says his case is different.

“If the cop is on the train, and I get robbed by a stranger, of course, the cop can’t be clairvoyant,” Lozito told The Post. “But when they’re looking for Maksim Gelman, and Maksim Gelman bangs on the door and says, ‘Let me in, I’m a cop’ and all you say is: ‘No, you’re not?’ ”

1. Joseph Lozito enters the uptown No. 3 train, sitting behind the train operator. Officers Terrance Howell and Tamara Taylor enter the operator’s booth; a few minutes later, the train slowly pulls out of Penn Station.

2. Maksim Gelman walks up to the booth and says: “Let me in!” Howell allegedly dismisses him and Gelman walks away.

3. Minutes later, Gelman walks back up to the booth, looks at Lozito, says “You’re going to die,” and stabs him.

4. Lozito fights back, getting seven stab wounds during the 60-second struggle with Gelman, eventually pinning him and knocking the knife away.

5. Howell allegedly emerges from the booth, taps Lozito on the shoulder and says: “You can get up now.”