Prosecutors said the prison-based hit squad was suspected of being behind the July 18 attack on a party in the northern city of Torreon, which is near Gomez Palacio.
In that incident, assailants in five 4-wheel-drive vehicles stormed a birthday party and killed 17 mostly young people, including women, with automatic weapons.
Another 18 people were wounded in the attack.
Police found more than 120 bullet casings at the scene, and Najera said tests matched them to four assault rifles assigned to guards at the prison.
Similar ballistics tests linked the guns to earlier killings at two bars, also in Torreon, the capital of northern Coahuila state, he said.
At least 16 people were killed in those attacks on February 1 and May 15, local media reported.
Najera said the "criminals carried out their executions as part of the settling of accounts between rival gangs", adding that "disgracefully, these cowardly criminals then murdered innocent civilians on their way back to their cells".
Coahuila and neighbouring Durango are among several northern states that have seen a spike in drug-related violence that the authorities attribute to a fight between the Gulf cartel and its former enforcers, known as the Zetas.
|The accusations were shocking even for a country used to drug violence and graft [EPA]
The authorities blame violent drug gangs for around 26,000 deaths since Felipe Calderon launched an army-led crackdown on the cartels after becoming Mexico's president in late 2006.
Reports estimate that less than two per cent of crimes in Mexico result in prison sentences, but Sunday's accusations - shocking even for a country wearied by years of drug violence and corruption - suggest that even putting cartel members behind bars may not prevent them from continuing to commit crimes.
Francisco Blake, the interior secretary, said Sunday's accusation "can only be seen as a wake-up call for authorities to address, once again, the state of deterioration in many local law enforcement institutions ... we cannot allow this kind of thing to happen again".
Responding to the accusations and house arrest of the prison officials, dozens of prisoners protested on Monday on the roof of the prison in Gomez Palacio.
Some 60 family members also protested, outside the prison.
Together they sought the return of the prison's director and for the return of visits which have now been blocked by soldiers and police, said one protester.
They also sought to prevent the transfer of high-risk prisoners, which the authorities have threatened to carry out.