The incident, reported at around 2:30 a.m. local time (0730 GMT), occurred in the Penon de los Banos neighborhood, near the Mexico City International Airport, the city's Attorney-General Office tweeted.
It is still unclear whether the shooting was specifically targeted to the victims, the authorities said.
According to local media, those at the venue for a patronal feast celebration, began running out when they heard a series of shots.
From January to May in 2019, 651 intentional homicides were registered in Mexico City, the highest figure in the last five years, according to data from the National Public Security System.
In June, the local government created a special tactical group inside the police department to fight against criminal gangs.