Two train carriages were seen hanging from the structure, above a busy road. At least 65 people were injured, and seven are in a serious condition.
One person trapped in a car underneath the wreckage was pulled out alive.
This is the deadliest incident in decades in the city's metro system, one of the busiest in the world.
Local media broadcast CCTV footage showing the overpass collapsing, sending up clouds of debris. The crash happened at around 22:00 local time on Monday (03:00 GMT) near the Olivos station on the metro's Line 12, in the south-east of the city.
Mexico City Mayor Claudia Sheinbaum said an external company would investigate the cause of the incident. Earlier, she said it appeared a girder had given way on the overpass. The line, inaugurated less than a decade ago, will remain closed while a structural survey is carried out.
Speaking at a news conference alongside the mayor, President Andrés Manuel López Obrador offered his condolences to the relatives of the victims and said that "nothing would be hidden" from the Mexican people.
Residents had reported cracks in the structure after a deadly 2017 earthquake, according to local media. Mexico's El Universal newspaper says transport authorities made repairs following the reports.
A crane was sent to the scene to stabilise the carriages amid concerns they could fall onto the road, which forced officials to temporarily halt rescue efforts at night.
In chaotic scenes, anxious friends and relatives of those believed to be on the train gathered in the area. Efraín Juárez told AFP news agency that his son was in the wreckage. "My daughter-in-law called us. She was with him and she told us the structure fell down over them."
Gisela Rioja Castro, 43, was looking for her 42-year-old husband, who always take that train after work and had not been answering his phone. She said the authorities had no information about him. "Nobody knows anything," she told the Associated Press.
A passenger, 26-year-old Mariana, told El Universal that she and other people trapped among the carriage's twisted metal managed to escape through a window.
"We only heard a loud thunder, and everything fell apart," she said of the moment of the incident. "There were many people standing and sitting in the carriage, and when the carriage fell, we went flying and hit our heads on its roof."