Steven Esposito Video View Full Caption DCPI

MIDTOWN — A Staten Island man accused of masturbating in front of a woman waiting at a Midtown N/R train platform — and then pulling out a gun on a man who tried to stop him — is a retired NYPD officer who claimed he was just peeing on the subway platform, according to court documents and sources.

Steven Esposito, 56, made hissing sounds and then exposed himself to a 38-year-old woman while they waited on the southbound N/R platform at the Fifth Avenue-59th Street station just before midnight on Monday, according to authorities.

The woman started crying and Esposito then fled toward the exit, police said.

A 41-year-old good Samaritan who spoke to the victim chased after Esposito and filmed him with a cellphone, the NYPD said.

But as the two neared the exit, the retired officer pointed a handgun at the man told him to “turn around and mind your own f----ng business,” according to court papers.

Esposito then fled the station, authorities said.

Police arrested the Staten Island man on Wednesday and he was arraigned on misdemeanor charges of public lewdness and menacing. He was released without bail and is due back in court Dec. 1, according to court records.

Esposito later admitted to investigators that he pulled the gun on the good Samaritan but denied the public lewdness charge, saying he was only urinating inside the station, court documents show.