A Brooklyn man claims he’s been behind bars for more than two decades on a murder conviction because of a crooked detective.

Kevin Daniels says Detective Bob Schulman relied on Daniels’ own false confession, a drugged-up witness, and misleading testimony to nail him as one of seven men responsible for the deadly 1995 gunpoint robbery of a Livonia Avenue crackhouse.

Daniels, who is serving a 32 1/3 years to life sentence, has filed court papers seeking to have his conviction vacated.

In his new legal filing, Daniels, 48, slams Schulman for ignoring Daniels’ alibi and initial proclamation of innocence, and instead accepting a “voluntary” confession Daniels gave after hours of being held at the 73rd Precinct stationhouse, his lawyers argue.

The now-retired detective also misled the jury, claiming he was the only investigator to interview Daniels, then 24, before the dad of a developmentally disabled son allegedly confessed.

In 2017, Brooklyn prosecutors — in reviewing the murder conviction of another man in the case, Jabbar Washington — uncovered evidence that Schulman was not the only detective to speak with Daniels, whose lawyers say Schulman lied about that fact at trial.

Washington’s conviction was overturned. Detective Louis Scarcella handled Washington’s case. Fourteen people have had their convictions vacated as prosecutors and courts review the disgraced investigator’s work.

But the Brooklyn DA’s Conviction Review Unit chose “not to disturb” the remaining convictions in the case, including Daniels’.

Daniels “didn’t receive a fair trial. The jurors that convicted him were lied to and deprived of critical evidence,” said his lawyer, James Henning said.

A DA spokeswoman said they reviewed Daniels’ case “and found no reason to overturn it. The defense was invited to submit a claim and evidence for further review by our CRU, but they did not. We will now review their motion.”