A straphanger escaped with his life after he was beaten and shoved into the path of an oncoming subway train early Saturday in Union Square, authorities said.

The 41-year-old Manhattan man argued with two other men on the southbound N/Q/R platform in the Union Square station around 2:50 a.m., said cops.

The two men approached the victim and began punching him, causing him to fall near the platform’s edge.

While the man was lying near the platform’s edge, an incoming Q train struck part of his body, police said.

The victim suffered a head injury in the incident.

He was conscious and alert when authorities arrived, and was transported to Bellevue Hospital in stable condition.

Police are looking for the man’s two assailants.