The assailants, who arrived on motorbikes, opened fire on mourners as they were returning to their village from a funeral in the surrounding Nganzai local government area on Saturday afternoon. At least 10 others were wounded, Nganzai Council Chairman Muhammad Bulama told reporters.
Bulama said the attack was retaliation after the residents and local vigilantes fought off suspected Boko Haram militants during an ambush on their village last week, killing almost a dozen of them.
There has been no immediate claim of responsibility for Saturday's assault, but Boko Haram has repeatedly carried out attacks in the area in Borno state, the heartland of the Nigerian terrorist group's 10-year insurgency.
Boko Haram seeks to establish an Islamic state in northeast Nigeria, though it has spread its terror across the region's mountainous borders over the years into Niger, Chad and Cameroon, all of which surround the Lake Chad Basin.
Nigeria's military has regained control in parts of the country's northeast in recent years, but residents continue to face violence.
The Boko Haram insurgency has displaced nearly 2.4 million people in the Lake Chad Basin region, according to the latest data from the Office of the United Nations High Commissioner for Refugees.