A ticked-off driver pulled a loaded, stolen gun on a car — only to discover that it was full of plainclothes cops, a high-ranking police source said Sunday.

Glenn Grays allegedly pointed the .45-caliber gun out his window after cutting off the car carrying undercover detectives from the Brooklyn North Gang Unit on the westbound Belt Parkway on Saturday in Sheepshead Bay, according to the source.

Grays, a 31-year-old United States Postal Service employee, was arrested and charged with possession of a firearm and menacing, the source said.

He was ordered held in lieu of $25,000 bail following an arraignment in Brooklyn Criminal Court on Sunday evening.

Grays was wearing his postal-worker uniform during the incident.

The mailman was previously busted in March on charges of strangulation and property damage over a February incident, court records show. That case is still pending.

He’s expected back in court on the pistol charge Nov. 1.

The USPS did not respond to a request for comment.