A federal judge has tossed gun-possession charges against a Brooklyn man who claimed he was illegally searched — marking the second time since August that the same anti-crime unit saw a case dropped over suspect stop-and-frisk tactics.

Brooklyn federal Judge Roslynn Mauskopf said in a 24-page decision issued Tuesday that officers from the Brooklyn North Borough Crime Unit “lacked reasonable suspicion to stop and frisk” Martese Price on Feb. 27, 2013, while on patrol around Newport Avenue in Brownsville, even though he allegedly was packing a .380-caliber pistol.

The decision has agitated cops who are already irate over a federal ruling restricting the NYPD’s use of stop-and-frisk which Mayor de Blasio has decided not to appeal.

“Another gun is off the street because of the trained police officers, but the offender may still walk away scot free, and that is unconscionable,” said PBA President Patrick Lynch.

Another NYPD source said, “That’s the whole reason we have stop-and-frisk, to get guns off the street. So, what, we’re supposed to leave the guns and let the perps put us and everyone else in danger?”

Two of the four plainclothes officers who busted Price, Konrad Zakiewicz and Salwa Jwayyed, also saw a similar a gun-possession case against a drug kingpin’s ex-convict son tossed in August by Brooklyn federal Judge John Gleeson, who ruled their search of Ronald Mayo was illegal.

In the latest case, Zakiewicz claimed he was able to see the shape of a compact gun in the pocket of Price’s “sagging” pants and made the arrest.

But Mauskopf ruled that there was no way Zakiewicz or the other officers involved could have seen the gun, citing dim lighting where Price was spotted. She also cited holes in the officers’ testimony as a reason for excluding the gun as evidence.

“Given the loose fit of Price’s pants, it is simply hard to believe that any observer, even a trained police officer, could make out the shape of any particular object in one of the pockets, let alone determine that the object was of such nonrectangular and nonsquare shape as to rule out a cellphone or wallet, even while Price was walking,” Mauskopf wrote.

Price’s public defender, Kannan Sundaram, hailed the judge’s ruling, saying it should raise “serious concerns for the NYPD” and prosecutors.

Price, 23, of Brownsville, has a previous felony conviction and would have faced up to 10 years behind bars if convicted.

Prosecutors now have two weeks to decide whether they will appeal since they essentially have no case without the gun as evidence.

Robert Nardoza, a spokesman for the Brooklyn US Attorney’s Office said the feds are “reviewing the judge’s decisions and are considering our options.”

Additional reporting by Kirstan Conley