He got done in by his dipstick.

Cops in New York City were able to bust the alleged subway brake-yanker this week thanks to a cellphone-wielding straphanger — who caught the young man on camera “with his penis exposed” in a picture that was later used to identify him, prosecutors said Friday.

The “informant” had been minding their business on the C train platform at West 14th Street and Eighth Avenue when Isaiah Thompson, 23, came whizzing by on the back of a northbound train, according to the court complaint.

They snapped a photo of Thompson’s exposed unit and off he went — back into the subway tunnels of NYC to ruin another person’s day, prosecutors allege.

MAN ACCUSED IN MULTIPLE SUBWAY BRAKE-PULLING INCIDENTS ARRESTED, OFFICIALS SAY

The straphanger turned the pic in to police, who then used it to identify the alleged transit troublemaker a week later. Their encounter with Thompson allegedly went down on May 16.

On May 21, the subway perv was caught on surveillance video on the outside of a northbound 2 train — moments before its emergency brake was pulled at the same exact station where Thompson was caught exposing himself the week before, the complaint says.

CLICK HERE TO GET THE FOX NEWS APP

Two days later, Sgt. Jovanny Calderon — of Transit District 30 — watched the video, compared it to the May 16 photo of Thompson, and realized they had the same guy, according to prosecutors.

Cops took Thompson into custody late Thursday and he allegedly confessed to being both the brake-yanker and the penis perp. He was charged in Manhattan criminal court on Friday with criminal tampering, reckless endangerment and public lewdness.