Attackers burst into the mosque and sprayed worshippers with petrol before setting them alight, according to Yemen's official news agency, Saba.
Eight people had suffered serious burns, a local official told Saba.
The attack took place in Amran province, to the south of an area where government forces are battling against Shia Muslim militants.
It was not immediately clear if the mosque was used by Sunni or Shia worshippers.
"Security authorities are investigating to identify the assailants and the motives of this criminal act," Saba quoted Amran's Governor Taha Hajar as saying.
The most seriously injured people were taken to hospital in the Yemeni capital, Sanaa. Others were treated in local hospitals.
The government says the rebel fighters are followers of a Shia cleric, Hussein al-Houthi, and are drawn from the country's Zaidi Shia minority.
It accuses the rebels of wanting to set up clerical rule in Yemen.