The attack happened yesterday in Xalapa, capital of the eastern state of Veracruz, one of those hardest hit by Mexico's chronic drug-related violence.
A local police official said the gunmen arrived in two pickup trucks and started firing at people attending the funeral.
The Veracruz prosecutor's office confirmed the three deaths but gave no details.
The three dead men were described as low-level drug dealers who had allegedly taken part in killings in recent days in Xalapa.
Those three and the three others killed yesterday were part of the same criminal organization, the prosecutor's office said in a statement.
Drug-related violence in Mexico has left more than 80,000 people dead since 2006 as rival cartels fought each other and security forces battled crime gangs.