The court on Monday convicted Muhsen Yahya Munassar, 42, of murder and sentenced him to death by firing squad, court sources said.
The boys were attending a summer camp for memorising the Quran at a mosque in Lahaj province, about 300km south of the capital Sanaa, when the gunman struck on 30 July. The boys were aged between eight and 15.
Two other people were wounded in the attack.
Clashes between tribes and groups are frequent in the poor Arab country where unlicenced weapons are widespread after years of civil war.