A former chief at the city’s notorious Rikers Island jail complex and four of his underlings were convicted of felony charges Tuesday after authorities said they beat an inmate at the chief’s behest because the man had stared him down during a search of his cell.

Former Assistant Chief for Security Eliseo Perez and the four officers were convicted of attempted gang assault and other charges in connection with the June 11, 2012, attack on inmate Jahmal Lightfoot.

Perez retired from his position in 2013. The officers — Alfred Rivera, Tobias Parker, Jose Parra and David Rodriguez — remain on modified duty Tuesday, officials said. A sixth officer, Jeffrey Richard, who prosecutors said aided in covering up the attack, was found not guilty.

Prosecutors said the altercation with Lightfoot started when the officers conducted a contraband search, patting down inmates, tossing over mattresses and rifling around cells for prohibited items. They said that during the search Lightfoot locked eyes with Perez. Angered by the stare-down, Perez shouted out to a captain and five officers that Lightfoot “thinks he’s tough” and should be beaten, prosecutors said.

Authorities said the guards led Lightfoot into a small cell and then pummeled him so severely he had fractured eye sockets, a broken nose and bruises that left his eyes swollen shut. Prosecutors also alleged the officers, in an effort to explain Lightfoot’s injuries, filed false reports claiming Lightfoot had slashed an officer with a sharpened piece of metal.

The judge presiding over the case signed a gag order in February prohibiting lawyers in the case from commenting.

In a statement Tuesday, Norman Seabrook, president of the union that represents rank-and-file correction officers, said the verdict is unfair and unjust.

“Today’s verdict is an absolute travesty and yet another example of how Correction Officers are treated differently and disrespected for doing the job they are sworn to do — protect New Yorkers,” he said.

City Correction Commissioner Joseph Ponte said that he had “zero tolerance for any illegal behavior on the part of staff” and that officers convicted of felonies would be terminated. He said he’s confident the correction department is taking the right step toward reforming Rikers.

The trial came just weeks after lawmakers called for the closure of the jail complex. Mayor Bill de Blasio, a Democrat, has said those calls are “noble” but that the proposal raises major financial and logistical issues.