Karl Harford, aged 23, and Tony Dempsey, aged 20, pleaded guilty to committing violent disorder at the Basin St flat complex, Dublin 8 on July 11, 2013.
Both men had been on bail at the time for other offences.
Harford was sentenced at Dublin Circuit Criminal Court to five years, with the final two-and-a-half years suspended, while Dempsey got a three-year sentence with the final year suspended.
Harford, Dolphin House, Rialto, and Dempsey, of New Road, Inchicore, were sentenced yesterday for this and other violent offences.
A third accused, Eddie Dempsey, aged 24, of New Road, Inchicore, has already been sentenced to two years in prison for violent disorder.
A fourth accused is due to be arraigned today for his role in the same offence.
Judge Mary Ellen Ring said Harford’s real problem seemed to be his difficulty controlling his temper.
The court heard Harford has 149 previous convictions and had been on bail at the time as part of an eight-year sentence after he was caught with a petrol bomb.
His five-year sentence imposed yesterday will begin when his current eight-year sentence is served.
Tony Dempsey, who has 43 previous convictions, had also been on bail for a separate offence.
Garda Kevin Lawless said Karl Gavin had been on his way to visit his sister when he was “viciously assaulted” by a gang of youths. They beat Mr Gavin up with their fists, then with a crutch. He was also stabbed with a knife twice in the back.
Separately, Tony Dempsey was sentenced to two years in prison for possessing stolen property, including an axe, on August 7, 2013. His two-year sentence was backdated to July 1, 2014, and will run concurrently to the three-year sentence above.
Harford was sentenced separately to five weeks in prison for breaching the peace at the Criminal Courts of Justice, Parkgate St, on September 4, 2013.
Judge Ring ordered both Harford and Dempsey to keep the peace and be of good behaviour for the suspended portions of both of their sentences.