“They shouldn’t have held him without bail,” said Mr. Pacheco, 28, sitting in the EZ Does It barbershop, which he owns. Mr. Cummings is a barber there. “And they shouldn’t be charging him, an addict, with manslaughter.”

Joyce Fobbs, 58, and her son, Anthony White, are among the 15 people arrested in the case. Ms. Fobbs said she and her son were also stuck in heroin’s grip and need help. She said the case — which Mr. McMahon’s office has dubbed “Operation Final Kut” — seemed overblown. Another defendant, Raymond Lugo, 52, who was arrested with his brother, Nelson Lugo, said the prosecution felt like a test case, or legal stunt, to send a message to dealers.

“Why would they use us as a guinea pig?” he asked.

Mr. McMahon conceded that the case against Mr. Cummings represents a “hard standard” to prove in court, but that it was far from contrived. Instead, it grew naturally from two separate investigations linked by Mr. Zeifert’s overdose. On Dec. 23, 2016, investigators opened a homicide-style inquiry into his death, analyzing his phone and other evidence from the scene, doing interviews and tracing the toxicology from his autopsy. Then, Mr. McMahon said, after Mr. Cummings told the undercover officer on Jan. 3 that he had warned Mr. Zeifert, 52, about the power of the drugs, the inquiries were joined.

It was a strategy Mr. McMahon forged for just such deaths after taking office in January 2016, weeks after the borough’s sprawling heroin crisis hit home: “A young man in my neighborhood, right down the block from me, collapsed on the front lawn and died,” he said, adding that he had watched the boy grow up.

Prosecutors say users have an increasing thirst for combinations of heroin and fentanyl, which they refer to as “fire” for its power. Yet they believe they can control the drugs, said Antonia Assenso, an assistant district attorney in Mr. McMahon’s narcotics investigations bureau who is assigned to the case.

“They think it is not going to happen to them,” Ms. Assenso said. “They think that they will be able to, basically, play God, but get that ultimate high.”