A Sheepshead Bay father was so angry when he found his heroin addict son’s stash that he shot it up himself and almost died of an overdose — just to send a message to his kid.

“I told him if you’re not going to stop, I will do the same as you do,” Sergey Gnatovskiy, 45, told The Post. “I [tried] to send him to rehab. He promised me he was going to go, and I found it again.”

But the risky life lesson seems to have worked: Son Maykl, 23, claims he’s been scared straight back to rehab after finding his dad passed out on the floor of their living room Wednesday afternoon.

“After seeing this, I definitely want to go. I’ve been doing this since I was 15. I’m 23 now, I can’t keep doing this,” he said.

Maykl says he instantly recognized that his pop was overdosing, and used CPR and Narcan nasal spray to bring him back from the brink — something Sergey has had to do for his son on four separate occasions.

The elder Gnatovskiy says he felt back to normal the next day and doesn’t recall much of the ordeal — he remembers going to turn off the TV and then waking up with “medical people” around him.

“My son was screaming at me, ‘Pop, Pop, are you crazy, you almost died,’” he said.

Maykl’s mom kicked the boy out of her house over his addiction as a teen, and Sergey has been trying to help him ever since, the father said.

But his boy is in trouble with this apartment complex over a fight with an ex, and now both men are at risk of eviction.

“I’m trying to kick him out of my apartment and into rehab. We’ve been notified of eviction and I need to prove he’s gone by May 31, which was yesterday, or I’m out as well,” Sergey said.

The loving dad, who originally hails from Ukraine, says he’s willing to lose everything to keep his son alive.

“If I lose you — I don’t know. Look what you made me do yesterday? I’ll give you my home, my car, my heart. I don’t want to lose you,” he yelled at his boy as a single tear ran down his cheek.

New York’s community of immigrants from the former Soviet Union have been hit particularly hard by the heroin epidemic, according to a 2015 study published in the Journal of Addictive Diseases.

Brighton Beach and its surrounding neighborhoods saw the highest number of per-capita heroin overdoses in southern Brooklyn between 2014 and 2015, according to city data.

And the number of people dying from the drug has surged across the borough in general — from 188 people in 2013 to 258 in 2015.