A veteran Queens lawyer has been caught in an audacious plot to make millions — first by paying a murder witness to falsely recant, then getting the killer released and ultimately cashing in on a bogus wrongful-prosecution lawsuit, authorities said.

The get-rich-quick scheme, which was thwarted before it could begin, is outlined in legal papers filed by federal prosecutors against lawyer Scott Brettschneider and three co-defendants — Charles Gallman, Richard Marshall and Reginald Shabazz-Muhammad.

Gallman, a criminal with a record of bribing witnesses, was heard on a wiretapped call to Brettschneider, describing the long sentence given to the unnamed murderer — whom they not only didn’t represent, but had never even met.

Behind his back, the other co-defendants called the hefty Brettschneider “Mighty Whitey,” according to the papers.

“Scott, we gotta get this guy as a client,’’ Gallman was picked up on the tap telling Brettschneider, according to the court papers.

Gallman brainstormed with the lawyer on strategy — suggesting they tell the murder witness exactly what to say if he was challenged on his bogus recantation.

“Police told him to lie,” Gallman suggested the witness insist. “He better say it’s this guy else they’re going to lock him up.’’ Brettschneider responded: “Oh absolutely.’’

The schemers knew just how to guarantee that the murderer would hire Brettschneider for an eventual wrongful-prosecution lawsuit.

They wouldn’t let the prisoner have access to the false witness recantation unless he hired the law firm, the feds allege.

The tap also picked up Brettschneider and Gallman dreaming about all the money they would make on the murder case.

Brettschneider thought he and Gallman would divvy up the one-third lawyer fee on a $22 million pot the murderer would collect from a lawsuit.

Even though they hoped the plot would yield millions, they were trying to nickel and dime their new “witness’’ — by offering to pay him only a measley $150 fee.

Gallman promised him more money in the future, saying “defendants who are coming home from doing 20-30 years’’ sue for “six, seven, eight million.’’

The lawyer explained to the “new’’ witness that he wouldn’t get his money until the lawsuit went through the courts.

“The money don’t come till the lawsuit, but we trying to get some upfront money,’’ he told his prized “witness.’’

He added, “I plan on all of us having six, seven hundred thousand out of this s–t.’’

The other two co-defendants were allegedly involved in other dirty tricks with Brettschneider, who could not be reached for comment Saturday night.