The accident happened in the 3800 block of Ridge Line Drive around 1 a.m., San Bernardino County Fire said.
Three people were ejected from the silver 2003 Nissan Altima and two others were trapped inside after it went over the edge of Ridge Line Drive in the hills of San Bernardino.
Police say the car carrying five people was headed up the hill - the road makes a slight curve, but the driver continued straight, traveling right over the edge.
The car rolled several times and fell 200 yards down the side of a hill and ended up in a ravine, San Bernardino County Fire said.
Cesar Andrew Caro, 24, of San Bernardino and Jennifer Blancas, 19, of Banning were pronounced dead at the scene.
Firefighters found the third man who was ejected. He was immediately rescued and transported to the hospital with multiple fractures to his spine. He was identified as a 23-year-old man from San Bernardino.
A female and a pregnant woman, both 19, were trapped inside the car. The pregnant woman was airlifted to the hospital, but suffered extensive injuries including the loss of her unborn child. The other female did not suffer any substantial injuries.
"It sounded like something was scraping at the back door, and it went on for a little while, uh, so I got up and walked around the house," said neighbor Brian Bouskill. "I looked outside and I didn't see anything because I didn't look up the hill. When I went back to bed, my wife woke up and she looked outside and saw the car on the side of the hill."
The San Bernardino Police Department is investigating the accident. Neighbors say they heard cars racing and wonder if that could have been a factor in the crash.
Investigators say there was evidence at the scene that indicates most of the occupants in the car were under the influence of alcohol at the time.
Anyone with information regarding the incident was urged to contact San Bernardino police Officer E. Thomas at (909) 384-5791.