In a statement, police said the three victims were killed at an intersection on the edge of Plaza Garibaldi, a major tourist destination packed with mariachi bars, just as the capital was kicking off independence day weekend celebrations.
The victims had been at a restaurant when the shooting started around 10 p.m., media said, adding that forensic officials had counted more than 60 bullet cases at the scene.
The identity of the three dead was not immediately clear, but the Milenio newspaper said they were men. Another newspaper said two of the injured were women.
Four of the injured were hurt as the gunmen fled, Mexico City police chief Raymundo Collins told reporters.
Videos on social media and television showed a heavy police presence, with the attack site cordoned off and yellow markers where the bullet casings fell, but dozens of people continued to drink and listen to live music nearby.
Police blame much of the capital's crime on retail drug dealing and protection rackets run by violent gangs, though the government says 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 police say is behind a spurt in drug-dealing and protection rackets.