September 8, 2021 | 3:39pm

Erika Jayne is on the outs with most of her “The Real Housewives of Beverly Hills” co-stars amid her mounting legal problems, but Lisa Rinna still has her back.

Jayne, 50, has been turning to the 58-year-old former “Melrose Place” star for support after feeling like the other cast members mocked her in recent episodes, a source told Page Six on Wednesday.

“Lisa is the only friend left because this week’s episode is hard for her to watch with some of the women making fun of her,” the source explained.

A rep for Jayne declined to comment. The Daily Mail was the first to report the news.

It’s unclear if the drama will be addressed when the show’s cast — which also includes Kyle Richards, Dorit Kemsley, Sutton Stracke, Garcelle Beauvais and Crystal Kung Minkoff — gathers later this week to tape a reunion show.

Tensions between Jayne and her co-stars have been brewing all season long, especially after she told Stracke to “shut the f–k up” during a tense confrontation at Kathy Hilton’s home about Jayne’s legal troubles with husband Tom Girardi.

“I have enough problems,” she told Stracke, who made it clear that she wanted to distance herself from Jayne.

Erika Jayne and Lisa Rinna at BravoCon
Erika Jayne’s “only friend left” on “RHOBH” is Lisa Rinna.Getty Images

“I only have enough capacity for the things that really matter, and your opinion of me does not matter.”

Stracke previously remarked that Jayne’s “ignorance” about Girardi, 82, allegedly stealing money from his clients was “not an excuse” for the singer allegedly spending the money she was receiving from Girardi.

Jayne also found herself at odds with Kemsley after the Beverly Beach by Dorit founder tried to explain Stracke’s opinion to her at the same dinner.

“I do not believe there’s a single person at this table that doesn’t want to see you come out of this,” Kemsley, 45, told Jayne. “I am going to support you to the bitter end. I will do anything you need, anything. But holy s–t, when you’re reading about the victims and the orphans, that’s very hard to digest.”

The mom of two added that the cast “never had an indication” that Jayne would be involved in the scandal, but Jayne wasn’t having it.

She shot back, “Then why are you torturing me about it?”

An insider previously told Page Six that the on-screen tensions between Beauvais and Jayne began after a misunderstanding — and bad editing.

While the “How Many F–ks” singer accused Beauvais, 54, of “betraying her friendship” by revealing that Girardi still called her amid their divorce, the insider said she was actually “betrayed” by producers and Bravo.

“They cut it and paste it in a way to make it look like she was upset, but she was actually mad that Garcelle was told what to say three times and she took the bait,” the insider remarked. “They had three different conversations about the same subject.”

“What they didn’t show is that Erika and Crystal [Kung Minkoff] had a private conversation where no cameras were on, and producers heard it via their mics,” the insider explained. “When they got in the car, producers said they overheard it and asked Crystal to ask [Erika] on camera. Bravo didn’t want to do the fourth wall. They pulled a fast one.”

However, a separate source told us at the time that “Erika’s reaction to Garcelle was genuine.”

It is unclear where the tension between her and Richards began.

“The Real Housewives of Beverly Hills” airs Wednesdays at 8 p.m. ET on Bravo.