The leader of the Civilian Joint Task Force (CJTF) in Ajiri Yala, some 15 kilometres (10 miles) north of Maiduguri, said the attack happened at about 4:30 am (0330 GMT).
“A male suicide bomber disguised as a worshipper entered the mosque while people were gathering for the morning prayers,” he told AFP by telephone.
“He detonated his explosives. He killed five people and injured several others.”
Boko Haram typically never claims responsibility but has used suicide bombing as a frequent tactic in its eight-year insurgency to establish a hardline Islamic state
Mosques that do not ascribe to its extremist views are seen as legitimate targets, as are people and places seen to be supportive of the secular government.
On Sunday, a CJTF member manning a checkpoint in the Muna area of Maiduguri was killed and another injured when two women strapped with explosives blew themselves up.
Last Sunday, 14 people were killed when three women detonated their explosives near the Muna Garage camp, which is home to tens of thousands of people made homeless by the violence.
The United Nations warned recently that attack against internally displaced people (IDPs) in camps across the region “continue to be a major concern”.
– Rural communities –
Communities in hard-to-reach areas of the remote region are also vulnerable and at the weekend, two women blew up in the Gulak area of Madagali, in the far north of Adamawa state.
A former local government area chairman, Maina Ularamu, said there were two blasts in Dar village on Saturday night and Sunday morning.
“Our suspicion is that they intended to attack the church, which is located inside the primary school about 100 metres away from the scene of the explosion,” he said.
Ularamu said locals suspected the two women had come to Dar from the Sambisa Forest, in neighbouring Borno, where Boko Haram was known to have bases.
The military said earlier this year it had retaken control of the former national park but there are reports the militants have moved back in.
They are also known to have been holed up in the Mandara mountains that lie east of Madagali and form the border between Nigeria and Cameroon.
On August 2, Boko Haram fighters stormed the village of Mildu, near Madagali, killing six.
Ularamu said Boko Haram “remnants are still lurking” in remote villages and the Sambisa Forest, and troop reinforcements were needed.
Attacks on civilians have largely been attributed to the Boko Haram faction led by Abubakar Shekau.
Strikes against the military are generally blamed on the Islamic State group-supported faction headed by Abu Mus’ab al-Barnawi.
Last week, at least 15 soldiers were killed in a raid on a military camp north of Damaturu, which is the capital of Yobe state bordering Borno to the west.
A military source said troops who had since been on high alert on Saturday inflicted heavy losses on a large contingent of Boko Haram fighters near the Yobe village of Goniri.