This happened at the centre of an escalating insurgency increasingly targeting civilians, a police source said.
The assault in Bardari late on Wednesday came a day after officials and witnesses said raiders killed scores of people in three other villages in the Borno region, where Boko Haram insurgents first launched their campaign to carve out an Islamist state.
The gunmen in military uniform called the Bardari villagers together, then opened fire, the police source told Reuters. "The people couldn't identify them in time as terrorists."
The militants then fled, crossing a river and setting fire to houses in the neighbouring village of Kayamla, close to the regional capital Maiduguri, added the source.
Boko Haram has killed thousands since it started its revolt in Africa's largest oil-producing country in 2009 and grabbed world headlines in April when it abducted more than 200 schoolgirls in another part of Borno state.
The mass kidnapping has piled political pressure on President Goodluck Jonathan, who has accepted help from the United States and other foreign powers to try to free the girls.