The overnight raid targeted the town of Ngamdu in troubled Borno State, the area hardest hit in the Islamists’ five-year uprising.
When locals woke they discovered “seven people had been brutally killed,” said resident Musa Abor.
The gunmen “slit their (victims) throats just the way people slaughter goats,” he added.
Abor and a Borno State official, who asked that his name be withheld, said the bodies had been decapitated, in the latest act of gruesome violence blamed on the Islamists who have killed more than 10,000 people since 2009.
In recent months, Boko Haram insurgents have targeted reprisal attacks at locals who have fought alongside the military as vigilantes.
An army officer in Borno, who also requested anonymity, said 15 Boko Haram fighters were killed in clashes in Ngamdu two weeks ago and the group had vowed revenge against the community.
Those killed on Monday could not immediately be identified as vigilantes and the defence ministry was not available to comment on the attack or the alleged beheadings.
The violence came as Nigerian Muslims marked the Eid al-Adha festival, a public holiday in the religiously divided country. Most Islamic holidays in recent years have been marred by Boko Haram violence.
The militants are thought to be in control of more than two dozen towns and villages in the northeast, but the military has vowed to retake all lost ground as part of a continuing offensive launched in May of last year.
The military had imposed a travel ban across Borno and neighbouring Yobe to last through the Eid holiday to guard against insurgent attacks.
But the measure is almost impossible to enforce in the remote region, where analysts say the army does not have enough troops on the ground to patrol a vast area with a terrible road network and poor mobile phone coverage.
At least eight people were also killed in Cameroon on Monday in a rocket attack blamed on Boko Haram.
A police officer told AFP that Boko Haram militants fired the rocket from the Nigerian town of Banki which hit the town of Amchide in the far north of Cameroon.
“The rocket landed in Amchide, killing eight civilians and injuring many more. We fear that the number of dead will rise,” said the policeman, who asked not to be named.
A Cameroonian security agent said the rocket landed in a road where many people were shopping.
Boko Haram took control of Banki several weeks ago and the militants have tried to make incursions across the border into Amchide.
The residents of Amchide have set up self-defence groups to fight off the Islamists.