Lovato made the comments in her YouTube docuseries Demi Lovato: Dancing with the Devil, which premiered on Tuesday.
The 28-year-old singer said she was “left for dead” by her drug dealer after he raped her during the overdose.
She then referred to another assault that happened when she was a teenager.
“I lost my virginity in a rape,” she said. “We were hooking up but I said, ‘Hey, this is not going any further. I’m a virgin and I don’t want to lose it this way.
“And that didn’t matter to them – they did it anyways.”
Demi Lovato addresses suspected overdose for first time
Lovato did not name her attacker but said she “had to see this person all time” after the assault.
She added that she reported the attacker but “they never got in trouble for it – they never got taken out of the movie they were in”.
Lovato said she wanted to “set the record straight” with the documentary, which features a friend telling the camera “she should be dead”.
She added: “I’ve had a lot of lives, like a cat. I’m on my ninth life.”
Lovato said the rape and pressure to maintain an image of purity contributed to her struggles with bulimia and self-harm at the time.
“The Christian, southern girl in me didn’t see it that way because sex was not normalised as a child or in the south,” she said.
“And, you know what, f*** it, I’m just gonna say it: my #MeToo story is me telling somebody that someone did this to me, and they never got in trouble for it. They never got taken out of the movie they were in.”
The four-part documentary series Dancing With The Devil is directed by Michael D Ratner and promises to give fans “unprecedented access” to Lovato’s recovery and career since the overdose in July 2018.
This is the third documentary featuring Lovato.
The 2012 film Stay Strong explored her recovery after she cancelled a tour with the Jonas Brothers to enter rehab.
In 2017’s Simply Complicated, Lovato admitted she had been dishonest in Stay Strong and had been under the influence of cocaine during the making of the film.