Five men dressed as mariachi musicians and reportedly armed with rifles and handguns opened fire on the plaza before escaping on motorcycles.
A foreigner, who was not identified, was among the eight others who were wounded, the prosecutor's office said.
In a statement, police said the victims died close to Plaza Garibaldi, a major tourist destination packed with mariachi bars.
Many Mexicans wear mariachi costumes, a symbol of national pride, on Independence Day to commemorate the launch of the revolt against Spanish rule on September 16, 1810.
The prosecutors' office said investigators were trying to find those responsible for the attack, but few crimes in Mexico are solved.
Plaza Garibaldi borders one of Mexico City's most notorious neighbourhoods, Tepito, home to La Union gang, which police say is behind the increase in drug dealing and protection rackets.
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.
Mexicans heading into Independence Day celebrations have been jolted by a brazen shooting that left four dead and nine wounded in Garibaldi Plaza, a famous square where mariachi musicians serenade tourists.
One witness, who was at a restaurant with family and friends, said he quickly closed the curtains and barricaded the door with tables.
Another 37,000 people are reported as missing.
Crimes and scams have plagued Garibaldi Plaza for years.
Officials in the Mexican capital have blamed the rise in crime on drug dealing and protection rackets, while the government claims that at least one of the city's violent gangs is connected to the Jalisco New Generation Cartel.