A 20-year-old Hasidic woman died of a heroin overdose in Brooklyn last month — showing how even an ultra-insular religious community isn’t immune to the nation’s opioid epidemic.

Malky Klein’s mother discovered her daughter slumped over in bed and frothing at the mouth around 7:15 p.m. June 24 in their Borough Park home, according to police.

The Jewish volunteer ambulance service Hatzolah was called and medics tried to revive the young woman before taking her to Maimonides Hospital.

But by 8:22 p.m., doctors at Maimonides had pronounced her dead.

Malky’s overdose death is not an isolated incident, according to community members.

“We’re definitely losing more people to drugs — there’s no question,” said Yaakov Behr­man, who runs the Crown Heights drug prevention group Operation Survival. “It’s getting worse in the United States, it’s getting worse in the world, and it’s affecting our community.”

Zvi Gluck, who works with suicidal and drug-addicted Jewish youth at his Manhattan-based group Amudim, has personally counted 60 opioid-related deaths among the metro area’s Orthodox Jews since the start of the year. Twenty of those were Hasidic.

Layala Rauch, 24, a close friend of Malky’s, said feelings of isolation are driving heroin use among Hasids. Rauch, who was raised Hasidic but strayed from the sect, said that from a young age, Klein embraced a more mainstream identity that alienated her from her ultra-religious community, getting her kicked out of a conservative religious school in Kensington and landing her at a school for troubled kids in Midwood, where she and others turned to drugs.

“This happens to many girls,” said Rauch.

Gluck and Behrman argue there is no straight line from Hasidism to addiction.

“It pains me when people make it a Hasidic issue,” Gluck said. “With suicide, it has certainly been among Hasidim that have left the fold. On the addiction side, though, it’s an equal-opportunity offender.”

Behrman blamed a rise in drugs on city streets for the rise in Orthodox and Hasidic overdoses.

“In many cases, the families are committed to getting help for their family members. They’ve tried, they’ve gone to professional help, attempted to put their child through rehabilitation. But if the kid is addicted and experimenting, there is very little the family can do,” he said.

Gluck and Rauch both know Klein’s family and agreed the parents did all they could.

The family kept anti-overdose drugs on hand, and Klein’s father was the first to administer one during her fateful overdose, according to a Hatzolah first responder.

The parents paid for two years of rehab in California — from which Klein had recently returned, Rauch said, adding: