Police union boss Patrick Lynch’s rookie-cop son has been stripped of his badge and gun for fleeing the scene of an accidental, off-duty gun-firing in Queens, The Post has learned.

Kevin Lynch, 23, was in the back seat of a pickup truck while another, unidentified cop — whose dad is an NYPD captain — was showing off his handgun to a third man in the front, sources said Tuesday.

The cop holding the gun accidentally pulled its trigger, firing a bullet through the roof of the Chevy Silverado, sources said.

All three men panicked and ran away, leaving the truck parked in Whitestone on Sunday night.

A neighbor called 911 to report the gunshot, and investigators tracked down the third man, a civilian who was not identified. The third man identified Lynch and the other cop, sources said.

The cop who fired the shot was suspended without pay, while Lynch was put on desk duty, sources said. Both are assigned to Queens’ 113th Precinct in southeast Jamaica.

Lynch, who joined the NYPD in 2014, is the son of the longtime president of the Patrolmen’s Benevolent Association.

Patrick Lynch has an older son, also named Patrick, who joined the NYPD in 2012. That son answered the door at the family’s Bayside home and refused to comment Tuesday.

His father did not return requests for comment.

NYPD rules generally require officers to be armed at all times when in New York City, with exceptions including while off duty and engaged in activities that could lead to the weapon being stolen, while working a second job, or while consuming alcohol.

The NYPD’s Patrol Guide also requires any cop who fires a weapon within the city to immediately request a patrol supervisor and safeguard the scene pending an investigation that goes up the chain of command to the borough’s Firearms Discharge Advisory Board.

Additional reporting by Joe Marino