Two Brooklyn cops sideswiped a parked SUV, then arrested a man sitting in the passenger seat of the vehicle, accusing him of damaging their car, a suit charges.

And the officers would have gotten away with their lie — had the whole bizarre drama not been caught by a security camera.

Robert Jackson, 31, told The Post his nightmare began when a police car heading the wrong way on one-way Watkins Street in Brownsville scraped against a parked Ford Explorer, which belongs to his girlfriend.

Jackson, a maintenance worker, said he was sitting in the legally parked car outside of his apartment when the accident happened. He got out of the vehicle and walked up to the officers.

“I was smiling, like, ‘How’d you run into me?’ ” he recalled. “Then the cop said, ‘Dude, you ran into me.’ ”

“I just wanted them to fix the damage and apologize, but it didn’t turn out that way,” Jackson said. “They were trying to cover it up.”

At that point, things got even more surreal.

The two cops checked the block for surveillance cameras before arresting him for destruction of city property, according to the lawsuit filed by Jackson in Brooklyn Supreme Court.

“When they thought no cameras were on. I saw their gloves go on, and that’s when I was arrested,” Jackson said.

But fortunately for Jackson, the officers, Christopher Oliver and Shazad Shigri, missed one camera on the home of one of his neighbors, Jackson said.

The video, reviewed by The Post, corroborates Jackson’s story.

It shows the police car going the wrong way down the street on April 17, 2013, and scraping the parked SUV as the officers try to make room for a truck to pass.

Though charges were eventually dropped, Jackson had to spend a night in a “filthy, overpopulated, rat- and rodent-infested cell,” his suit says.

“The officer who arrested me said if I took care of the expense on my vehicle, they would take care of their vehicle and I wouldn’t have gotten arrested,” Jackson recounted. “He knew he was wrong.”

The NYPD referred comment to the city Law Department.

The city Law Department said only, “We will review the complaint.”

The suit charges that the officers “falsely claimed that [Jackson] was operating the parked motor vehicle and that [Jackson] caused the parked motor vehicle to strike the NYPD vehicle.”

Jackson was arrested for destruction of city property, disorderly conduct and resisting arrest, the suit states.

But he was officially charged only with unlicensed operation of a motor vehicle because he had a suspended license.

The criminal complaint drafted against Jackson says he had the keys in the ignition — which could support the unlicensed-operator charge — when the crash happened, but Jackson said that’s not true.

“If he’s claiming that he was not in the driver’s seat and the car was not on — if either of those claims are truthful, then he wasn’t operating the car under the law,” said Todd Greenberg, a defense attorney and expert on traffic law who is not involved in the case.

The suit, which names the city and the two police officers, seeks unspecified monetary damages.

— Additional reporting by Daniel Prendergast