The officials were taken to nearby hospitals.
The drama unfolded on Sunday at Medium A and B sections.
Simphiwe Xako, head of communications for the Department of Correctional Services, says warders witnessed an inmate assaulting another male inmate with a padlock in a communal cell.
When the warders intervened and tried to stop the assault, one of the prisoners attacked them with the same padlock used in the previous incident.
Four warders were left wounded while the attacking prisoner was left with minor injuries.
He was treated at the hospital section.
A fifth warder was attacked the next day at the Medium Correctional Centre by a person known as a “Remand Detainee”.
The attacker stabbed the warder with a broomstick.
Xako says they believe the attacks were part of gang rituals and that visitation was stopped on Sunday.
“Both these two incidents are seen as gang-related rituals,” he says.
“Lieutenant Commissioner Delekile Klaas has ordered an investigation into the matter.”