Four Riverside County sheriff's deputies, who pulled the family members from the flames, were also treated for smoke inhalation.
The fire was reported about 1:30 a.m. at a house on Dolan Drive.
Mayor Yxstian Gutierrez said the home was engulfed in flames and filled with smoke when the deputies arrived.
"They went right into the house and were able to find three of the individuals," Gutierrez said. "They were able to pull them out. They were unfortunately severely wounded and burned."
Tragically, they were unable to save the child, identified by family members as Joshua Cabrera. Nicknamed "Baby Halloween" for his birthday, he was to turn 2 this fall.
Four civilians were transported to a hospital in critical condition, along with the four deputies, Cal Fire Riverside Capt. Richard Cordova.
Dixie Fire now 2nd largest wildfire in California history, burning area larger than NYC
Firefighters extinguished the flames within 20 minutes, preventing it from spreading to nearby homes, officials said.
The fire started in the kitchen, according to family members, but a cause has not been determined. Apparently smoke detectors did not go off, family members say.
A GoFundMe has been established to help Joshua's family.
"He was a cute little baby," said neighbor Beatriz Medina. "A toddler. He was laughing. They were happy to have him here all the time."
His great grandmother, father and pregnant stepmother, who all lived at the Moreno Valley home, were pulled from the flames by Riverside County Sheriff deputies who rushed into the fire.
The boy's stepmother was counting down the days to her delivery.
"She's pregnant I think 32 weeks pregnant," Medina said. "I saw them last week and she was talking about how excited she was. It's a girl."
"I cannot even imagine what the Deputies, victims, and everyone at this incident went through," said Gutierrez. "Our thoughts and prayers are with the family for the loss of their child, and for our responders to be at peace after experiencing such a traumatic event. On behalf of the City, I thank our first responders for their heroic acts."
The cause of the blaze is under investigation.