A man stepped in front of a subway train in Manhattan on Sunday, but survived with just a nick thanks to a cautious motorman, according to authorities.

The man was wandering inside the tunnel near the 96th Street station beneath Lexington Avenue in a bright orange jacket and Army fatigue pants when he walked in front of a passing train at around 9:45 a.m., law-enforcement sources said.

Lucky for him, the driver of the southbound 5 train had heard a warning from dispatch to proceed with caution because of reports of a person on the tracks and had slowed to a snail’s pace shortly before impact, according to an MTA spokesperson.

“We had reports of an unauthorized person on the tracks by one of the trains in the area,” MTA spokeswoman Marisa Baldeo said. “He was already on the tracks.”

The contact between the man and the train left him nearly unscathed. He was able to get up and walk back out of the tunnel without assistance, according to FDNY sources.

More than a dozen paramedics met him on the downtown platform, where they put him on a gurney and placed braces on his neck and left ankle.

The man, who looked to be in his 50s or 60s, moaned and grimaced as he was strapped in. As six firefighters loaded him into an ambulance, he complained that he had hurt his foot when the train bumped him.

He was taken to Weill Cornell Medical Center for observation, authorities said.

Police withheld the man’s identity because he was not charged with a crime.

Law-enforcement sources said he appeared to be well-dressed. He wore clean-looking, warm clothes, including the orange winter coat, work boots, camouflage-patterned pants, gloves and a knit cap.

By 10:56 a.m., about an hour after the incident, train service had returned to normal, the MTA said.

Last month, another person climbed down to the tracks of the Upper East Side subway lines near 86th Street.

The woman laid on the tracks and was hit by a 6 train, interrupting service at the height of the evening rush hour.

Additional reporting by G.N. Miller

