Mexico City police said in a statement the victims were killed at an intersection on the edge of Plaza Garibaldi, a major tourist destination packed with mariachi bars.
Videos from the scene on social media and television showed a heavy police presence, with the site of the attack cordoned off, but dozens of people were still hanging out nearby.
After years of keeping a lid on the worst violent crime that has plagued Mexico, the capital has seen a surge in homicides since 2014 to record levels.
Police say much of the crime stems from retail drug dealing by violent gangs, although the government admits that at least one of these has links to a major national trafficking group, the Jalisco New Generation Cartel.
Plaza Garibaldi borders one of Mexico City’s most notorious neighborhoods, Tepito, home to La Union gang that police blame for rising drug dealing in the capital.
In August, police arrested the presumed leader of the gang, Roberto Moyado Esparza “El Betito”. Since then, the Tepito neighborhood has suffered a wave of violence, including several killings.
More about: Mexico