The attack happened early on Saturday in Wumbi in the Kalabalge district of northern Borno state and forced hundreds of residents to cross into Cameroon, they said.
"Boko Haram gunmen attacked our village around 4:00 am (0300 GMT) and killed two people while everybody crossed the river into Cameroon," resident Konto Yamani said.
"They came on 10 motorcycles and fired indiscriminately, which jolted people out of their sleep, before they began to set our houses on fire after looting our food stocks."
His account was supported by a second resident Haruna Wumbi, who said it was the second attack on the village in a week.
Details of the attack were slow to emerge because of poor to non-existent telephone networks in the remote region and the difficulties in contacting local residents who fled to Cameroon.
The attackers were believed to have come from Ndufu village in nearby Ngala district from where the terrorists were pushed out in February 2015.
Boko Haram has been largely routed out of Nigerian territory it controlled in 2014 by a military counter-insurgency since the turn of 2015.
But the militants still maintain control of some remote villages from where they launch raids on liberated areas, mostly in search of food.
Last week, at least 24 people were killed when Boko Haram fighters opened fired on mourners in a village near the town of Gulak, in Adamawa state, ABNA reported.
219