Troops heading to the town of Dikwa came under attack at about 9:00 am at Ajirin village, in the Mafa area, some 52 kilometres east of the Borno state capital, Maiduguri.
"There was a heavy gunfight. At least eight troops have been confirmed killed and two others injured. Boko Haram also suffered losses," a military source in Maiduguri told AFP.
"It was a surprise attack and this is what led to the casualty toll," the source added on condition of anonymity, as he is not authorised to talk to the media.
No one from army headquarters in Nigeria's capital Abuja was immediately available when contacted by AFP.
More From This Section
Nigeria's military and government have claimed repeatedly in recent months that Boko Haram, which is allied to the Islamic State group, is in disarray and nearly defeated.
The army has mounted a sustained counter-attack against the group in its Borno state stronghold of the Sambisa forest. In December, commanders said the rebels had been flushed out.
Nevertheless, there have been a number of attacks on military and police targets in Borno and the neighbouring states of Yobe and Adamawa, as well as deadly suicide bombings.
Residents in the village of Kautikeri, in southern Borno state, said Boko Haram killed one person and abducted a seven-year-old boy from the neighbouring village of Kaumutaiyahi today.
The rebels looted food stores before setting fire to the village, which is some 15 kilometres from the town of Chibok, from where Boko Haram abducted more than 200 schoolgirls in April 2014.
Today's raid and recent attacks on the road between Damboa and Maiduguri have prompted speculation the militants are still in the area.