A ménage à trois inside a Park Slope pad took a horrific turn early Monday — when one of the participants died after being stabbed and beaten with bats, police sources said.

The fated threesome between the 20-year-old male victim and another man and woman inside the home on 16th Street near Seventh Avenue ended after the victim starting filming the sexcapade, upsetting the female involved, sources said.

The other man involved in the sex session took the upset woman back to her home on Staten Island, leaving the victim alone in the apartment, sources said. The other man, 21, lived in the apartment, sources said.

The woman then contacted a man who went to the Brooklyn apartment with two pals, sources said.

Three men armed with knives and bats were captured on surveillance video chasing the victim as he tried to exit the building, sources said.

The victim was found by police lying in the lobby of the building — which is about a half-mile from Mayor Bill de Blasio’s 11th Street home — with a stab wound to his chest and severe trauma all over his body around 4 a.m., police said.

He was rushed to Methodist Hospital, where he was pronounced dead, cops said. His identity was not immediately released.

Shortly before the victim was bleeding out from stab wounds in the building’s lobby and desperately knocking on neighbors’ door for help, his girlfriend, who was not involved in the sex, received a threatening online message, according to sources.

“Your boyfriend f–ked up and will be taken care of,” the Instagram message to the victim’s girlfriend read, according to sources.

No arrests have been made.

Cops were questioning the 21-year-old man in the killing, but he is not a suspect, police said.

Additional reporting by Larry Celona