Brooklyn Borough President Marty Markowitz could find himself in a legal bind over contradictory testimony he and an aide gave in a lawsuit that alleges his office is run like a frat house, The Post has learned.

Markowitz answered “no” when asked whether he knew of complaints of “inappropriate” conduct or discrimination in his office made by Bridget Geary and two other female staffers, according to sworn depositions last year in a sexual-discrimination lawsuit filed by his former communications director, Regina Weiss.

The Beep’s response contradicts the testimony of his longtime ally and former chief of staff, Gregory Atkins, a co-defendant with Markowitz in Weiss’ 2007 suit.

In his deposition, Atkins said Geary became upset over a “joke about a sausage” that a male co-worker made. Atkins also revealed that he learned of the issue only after being directly contacted by Markowitz.

“She started calling the borough president in the middle of the night over the weekend and leaving voice mails,” he said.

Atkins said that Markowitz asked him to meet with Geary about the incident and that she was later accommodated with a transfer to another Borough Hall department.

Weiss said she found it unlikely that the Beep could forget repeatedly being called by Geary about the incident and then asking Atkins to handle it. She said Atkins’ testimony corroborates what she was told by two staffers with “first-hand knowledge” of the Geary complaint.

Perjury carries a penalty in New York of up to seven years in prison. If a case were pursued against the third-term borough president and he were convicted, it could cost him the $160,000-a-year elected post he has held since 2002.

Geary, a senior community liaison worker for Markowitz, declined comment.

Atkins testified he never documented Geary’s complaint in writing after granting her transfer.

Markowitz referred comment to city lawyer Diana Goell Voigt, who said Weiss’ allegations are “utterly false” and the borough president “in no way perjured himself.” However, when asked to explain the conflicting testimony, she declined comment.

Weiss’ suit — which city lawyers contend is “baseless” — accuses the borough president’s office of favoring male staffers, and it claims Weiss was wrongly forced out in 2006 for a younger male.

Bombshell court documents related to it have also accused the office of being a haven for sexist jokes, inappropriate sexual activity by staffers and illegal political-campaign activities.

While under oath, Markowitz also launched into a spirited defense of himself — and Tinkerbell. He insisted he was no sexist when testifying about why he nicknamed a former female press secretary “Tinkerbell” and called Peter Pan’s fairy pal a “loving” character.