The militants stormed Amarwa village, while lies about 20 kilometres (12 miles) from Maiduguri, the capital of Borno state and birthplace of Boko Haram.
According to a leader of a local militia fighting the jihadists, the gunmen shot indiscriminately at villagers and set fire to homes in the raid late Saturday.
“Two were shot dead and the other two choked to death in the fire the attackers set to houses,” militia leader Ibrahim Liman said, adding that a number of people were also injured.
A local chief said the attack in the village in the Konduga district started around 11 pm (2200 GMT) and continued past midnight.
“We have so far recovered four bodies, two of them with bullet wounds,” said the local chief, who did not want to be named.
“We lost our homes and food stocks in the fire.”
Amarwa also came under attack in May, when Boko Haram gunmen on motorbikes killed six farmers outside the village as they prepared for the planting season.
Konduga is a known hotbed of Boko Haram activity despite government and military claims that the jihadists are a spent force, having been forced out of their Sambisa forest enclave.
About 20,000 people have been killed and about 2.6 million have fled their homes since Boko Haram launched the insurgency in 2009.