The Baltimore prosecutor who brought charges against six cops in the death of Freddie Gray has close ties to the family’s lawyer — who contributed $4,000 to her campaign and served on her transition team.

Veteran attorney Billy Murphy, who is representing Gray’s family, has been a mentor to 35-year-old State’s Attorney Marilyn Mosby, prompting critics to say the deck was stacked against the cops.

Warren Brown, a veteran Baltimore defense lawyer who supported Mosby’s opponent in the 2014 election, said her handling of the Gray case was linked to her political ambitions and those of her husband, Baltimore City Councilman Nick Mosby.

“She is a politician; her husband is a politician. This is a watershed event,” said Brown, who believes Mosby was under tremendous political pressure to charge the cops in the case.

Brown and Ivan Bates, a former prosecutor and a current defense attorney in Baltimore, blasted Mosby’s ties to Murphy.

“I think she has too much pressure to not indict, from the pressure of her husband’s constituents, of her mentor Billy Murphy, and of the pressure of making sure she wants to hold on to her job in four years,” Bates said.

The police union even asked that a special prosecutor handle the case, citing Mosby’s potential conflict of interest and that her husband’s re-election would factor into her decision.

But Mosby said she has police officers in her family going back five generations and has no anti-cop bias.

“I come from five generations of law enforcement,” she said at a news conference Friday. “My father was an officer. My mother was an officer. Several of my aunts and uncles. My recently departed and beloved grandfather was one of the founding members of the black police organization in Massachusetts.”

With Post Wires