A high-ranking NYPD cop has been dropped from the feds’ list of “unindicted co-conspirators” in a hooker-fueled police corruption case set for trial next month.

In a letter to the judge, Manhattan federal prosecutors said they would no longer include Inspector Brian McGinn “as a member of the charged conspiracy.”

McGinn, who’s assigned to Patrol Borough Manhattan South, is “very grateful the US Attorney’s Office came to the right conclusion,” his lawyer said Thursday.

“The assistants on the case did a very thorough due-diligence review and he was able to clear his good name,” lawyer Oliver Storch added.

In April, the feds said McGinn was among three active-duty cops they suspected of wrongdoing, but opted not to charge, in the bribery case against former Deputy Chief James Grant.

The specific allegations against McGinn weren’t revealed.

Grant is accused of providing official favors to a pair of former donors to Mayor Bill de Blasio, co-defendant Jeremy Reichberg and Jona Rechnitz, who is cooperating with prosecutors.

In exchange, Grant allegedly got payoffs that included an all-expenses-paid trip to Las Vegas on a private plane with a prostitute dressed as a flight attendant.

The trial is set for Nov. 5.

A spokesman for Manhattan US Attorney Geoffrey Berman declined to comment.