Lawmakers are now rushing to try to meet a Dec. 15 deadline set by the Supreme Court for legalization aiming to remove the drug as a source of income for violent drug gangs.
Mexican news network Milenio said seven people were also injured in the shooting at the facility in Guanajuato state.
Mexico's president has ordered the armed forces to tackle security on the streets for another four years.
Security will be boosted at prisons in the state after the incident in the Varonil prison, which broke out around 2:30 pm on Tuesday afternoon, the government said.
"We were deliberately targeted, used as bait to lure one cartel against another," said Lafe Langford, a cousin of some of the victims, who grew up in the same Mormon village.
The victims belonged to the LeBaron family from a breakaway Mormon community that settled in the hills and plains of northern Mexico decades ago.
Jorge Ruiz Vazquez, a reporter at the Grafico de Xalapa newspaper in Veracruz's capital, died in spite of procedures in place to protect him, the state prosecutor's office said.