Six gunmen wearing police uniforms were allowed to enter the prison by unsuspecting guards who believed the men were delivering another prisoner, state prosecutors said.
"Once inside the prison, the armed group began an attack on inmates and then on guards in a security tower, where four prisoners and five attackers were killed," the attorney general's office of Guerrero said in a statement.
A prison guard and one of the alleged gunmen remained hospitalized with gunshot wounds.
Prison unrest is common in Mexico, where the government's human rights agency has drawn attention to the killing of dozens of inmates and prison guards as well as the presence of criminal gangs attempting to take over correctional facilities.
"We currently do not know if they were planning a mass escape or if this was simply a rivalry between two criminal groups," said a security official, who spoke on condition of anonymity.
Guerrero, along Mexico's southwestern coast, is one of the country's most violent states. It is home to several drug cartels, including the Zetas and the Knights Templar, who compete for control of territory and trafficking routes.