The on-again, off-again boyfriend of “Real Housewives of New York” star Bethenny Frankel was found dead Friday morning in his Trump Tower apartment of a suspected OxyContin overdose, police sources said.

Dennis Shields, 51, lost consciousness after asking his assistant to administer Narcan — a emergency antidote used to reverse an opioid overdose — at around 9 a.m., sources said.

The medication failed to revive the father of four, and emergency medical responders found him dead in his corner apartment on the 42nd floor.

Shields, who was the CEO of the litigation-funding firm LawCash, and Frankel, 47, had been friends for nearly 30 years before they began dating in 2016. The reality-TV star was high-school friends with his estranged wife, Jill.

Jill Shields said she was heartbroken over his death.

“Dennis was, and will always be, the love of my life,” she said in a statement. “His spirit lives on in our children. Please respect our family’s privacy at this time.”

A friend of the Dennis and Jill Shields said the pair remained close even after separating.

“Jill and Dennis spoke every day, that is true, and they were each other’s best friend,” the pal said. “He was in those kids’ lives, and he was an amazing father. It’s a devastating loss.”

In an interview Sunday, Dennis Shields gushed about Frankel, whom he dated on and off amid her divorce from Jason Hoppy, the father of her 8-year-old daughter.

“She’s great. She’s a great mother. She’s a great person. She’s really, really smart. She is terrific in every way,” he said on the “Listen Up Show with Mitchell Chadrow,” a business podcast.

He said their romance blossomed after he split from his wife.

“We remained friends the whole time that I was married — nothing but friends,” he said. “And then right after Jill and I got separated, Bethenny and I started dating, and we’ve been together on and off now for I think it was almost four years. That’s what she told me . . . But we do break up a lot.”

He joked about the public nature of their tumultuous relationship.

“I Googled her or me, and she said, ‘What are you doing?’ and I said, ‘I’m just checking to see how our relationship is doing,’ ” he told the podcast.

Shields made numerous cameos on “Real Housewives,” and Frankel, founder of the Skinnygirl cocktail line, spoke of their relationship often on the hit Bravo show.

“Dennis and I have a very independent relationship. Everyone wants us to define what it is. It’s not definable,” she said in an episode that aired this season, according to People magazine.

“We love each other, but the two of us have schedules that are off-the-charts insane. I’m OK with it being totally gray.”

Shields spent his professional career working in finance. He founded LawCash in 2000. The Brooklyn-based firm bankrolls questionable lawsuits against the city and charges plaintiffs exorbitant interest rates for cash advances on their settlements.

He also created Esquire Bank, which has a branch in Garden City, LI, and an online investment startup called YieldStreet.

Reps for Frankel didn’t return messages seeking comment.

The city Medical Examiner’s Office said Shields’ death was under investigation.

Additional reporting by Lia ­Eustachewich