A former New York broker — one of the FBI’s most successful informants ever — took a major step on Thursday to winning his second battle against Uncle Sam.

A New Jersey federal court judge agreed to limit the scope of the Securities and Exchange Commission’s case against him, The Post has learned.

The former broker, Guy Gentile, who turned rogue informant after he felt the FBI reneged on a promise to drop criminal charges against him, successfully blocked the SEC’s attempt to expand its case against him.

The SEC, which is seeking to recover $17 million from Gentile in an existing case, tried to convince Judge Joseph A. Dickson it should be able to expand the case because a separate probe “may be relevant” to Gentile’s case.

The SEC case — like the criminal case before it — stems from an alleged pump-and-dump scheme Gentile ran from 2007.

The criminal case has been dismissed.

Gentile maintained that he never did anything wrong.

Judge Dickson, during a conference on Tuesday, sided with Gentile, who argued that the SEC should cease any related investigations since his case is currently stayed pending a Supreme Court decision that could affect the outcome of his case.

The SEC had no comment.

Gentile, who runs a Bahamas-based brokerage, came to notoriety for his work as a confidential informant who helped the Feds put away big- name scammers.

When his successful work for the FBI was done, prosecutors moved to prosecute him on the 2007 rap.

Gentile claimed the government promised him it would drop the charges if his work as an informant was successful.

“This is retribution for me refusing to work with them anymore, for not taking their deal,” Gentile told The Post.

“Now they’re trying to renege on their deal,” he said. “They’re also trying to act as if there was no cooperation agreement. Then why did I do all that work if there was no cooperation agreement?”

Gentile, 40, informed on stock manipulators and bucket-shop owners — including Adam Gottbetter, who was sentenced to 18 months in 2015 for a penny stock scheme.

Unbeknownst to the Feds, Gentile had taped more than 100 conversations with federal agents, his own version of a get-out-of-jail free card.

Gentile got the criminal case tossed because it was brought after the statute of limitations had expired.

He is making the same argument in the pending SEC case. By not being able to expand their case, the SEC’s position is weakened, lawyers for Gentile claim.