Former Chicago top cop and mayoral candidate Garry McCarthy is calling on the Cook County state’s attorney’s office to up the charges against a 24-year-old man whose alleged use of a gun led to the deaths of two police officers last week on the Far South Side.

But the man’s lawyer said McCarthy is using the officers’ deaths for his own political gain.

The officers — Conrad Gary and Eduardo Marmolejo — died after being hit by an outbound South Shore Line train near 103rd Street and Dauphin Avenue on Dec. 17. Gary and Marmolejo were on the scene investigating a gunshot picked up by a ShotSpotter sensor.

Edward R. Brown, a prep cook from Rosemoor, is accused of firing the shot.

At his bond hearing Dec. 20, prosecutors said Brown found the gun in an alley on his way home from work at a downtown restaurant. Brown took the gun to the train tracks and fired into the air, prosecutors said.

Brown did not fire at the police officers, prosecutors said, and has no previous criminal record. He faces felony counts of aggravated unlawful use of a weapon and reckless discharge of a firearm. His bail was set by Judge Stephanie K. Miller at $200,000.

On Monday, McCarthy said Brown should be charged “at least with manslaughter and up to felony murder.” His comments come days after he criticized Cook County Board President Toni Preckwinkle — who’s also running for mayor — and Cook County state’s attorney Kim Foxx for letting Brown off easy.

“Toni Preckwinkle and Kim Foxx need to explain to the families and the Police Department why this individual was not charged with a more serious crime,” McCarthy said during an interview on right-wing talk radio station AM 560 on Friday.

The local chapter of the Fraternal Order of Police championed McCarthy’s comments in a Sunday blog post. The union called for “felony murder charges” against Brown last week.

In a statement, the state’s attorney’s office said it “was not presented with any other charges for approval” against Brown by the Chicago Police Department.

“After reviewing the case, Brown was charged with the most serious offenses based on the law and supported by the evidence,” the office said.

Families of the fallen police officers could not be reached for comment.

Felony murder is a legal doctrine that allows prosecutors to charge a defendant with murder for a killing that occurs during a felony even if the defendant is not the killer.

But there are very few felony murder cases involving Chicago police officers.

In 1997, a 17-year-old Chicago boy was charged with the murder of a Markham police officer who died after a Harvey police officer hit him with his squad car; both officers were chasing the boy, whom they believed had stolen the car he was driving, according to news reports.

The boy, DeSean McCarthy, was convicted of first-degree murder a year later and sentenced to 40 years in prison, news reports said.

Richard Kling, a clinical law professor at Chicago-Kent College of Law, said the deaths of Gary and Marmolejo should not be treated as a murder.

“Realistically this way a dumb kid who found a gun and did a dumb thing — he wasn’t shooting at anybody,” Kling said. “I’m aware you have to take the death of a police officer seriously, but the charges against [Brown] are exactly what they should be. This appears to be a horribly tragic but absolutely fluke case.”

Jeffrey Urdangen, clinical associate professor of law and director for the Center of Criminal Defense at Northwestern University, took issue with McCarthy’s comments, deriding them as “reflexive” and “unbecoming of somebody who we would entrust to have discretion in making decisions.”

“Nobody should be calling for someone to be charged with ‘a more serious crime’ until they’re fully informed with the underlying facts. I imagine the state’s attorney office is in possession of much more relevant information than what [McCarthy] has in hand,” Urdangen said.

Brown’s attorney, Frank Kostouros, said the former Chicago police superintendent should be “ashamed” for turning the deaths of two police officers into a bully pulpit.

“This is a blatant attempt to politicize this sad event,” he said. “Obviously this is a sad time for everyone involved, especially for the families of the police officers, but for a political candidate to use their deaths this way is appalling. We all support the police but their deaths are not a murder, and to try to make it into that is not appropriate. These officers died very bravely. These guys were heroes. For anyone to try to politicize their death would compound the tragedy of the situation.”