A third man, who was recruited following an earlier failed attempt to burn down the same mosque, was sentenced to 16 years for the crime.
The men - Ahmed Mohamed, 26, Abdullah Chaarani, 28 and Hatim Moukhaiber, 31 - torched the Imam Ali Islamic Centre in December 2016 in the middle of the night before spray painting "The Islamic State" on one of the building's walls.
They were found guilty of terror-related charges in May after the jury determined the crimes to be based on an extremist version of Sunni Islam inspired by the Islamic State group.
Judge Andrew Tinney said on Wednesday the men were motivated by "hatred" and "intolerance".
"Your particular purposes were to advance what to most sensible people can only be seen as being a perverse ideology, and more particularly, to strike a blow against, and to intimidate and cause terror to, Shia Muslims," he said.
Mohamed and Chaarani - who are still to be sentenced for their role in planning a terror attack around Christmas Day in 2016 - will serve at least 17 years for burning down the mosque.
Moukhaiber will serve at least 12 of his 16-year sentence.
Follow us on Twitter: @The_NewArab