Three suspects said a squabble between them and the victims had led to the fight late yesterday in the city of Reynosa, which borders the US state of Texas, said an official in the prosecutor's office.
The situation at the prison has been brought under control, the official said.
Drug cartels control several Mexican prisons, which are regularly the scene of riots, murders and mass escapes.
Late last month, seven inmates were killed and two others wounded in a fight in another prison in Tamaulipas state.