Suspected Boko Haram members opened fire on Katarko community in Gujba Local Government Area of Yobe State, leading inhabitants to run to safety.
A middle-aged woman and her sister were also hurt by the militants.
The attackers reportedly stormed the village in the early hours of Thursday, but were repelled by forces from Sector 2 Operation Hadin Kai, who had been dispatched to the area.
Katarko, 18 kilometers south of Damaturu, the state capital, has been attacked at least 15 times.
The hamlet was last assaulted on March 16, 2021, when rebels set fire to a primary school and a healthcare center.
In northeastern Nigeria, Boko Haram and its spinoff, Islamic State West Africa Province, have killed thousands and uprooted millions.
The Nigerian military has consistently stated that the insurgency has been mostly vanquished, and any losses are frequently downplayed.
Insurgents have begun targeting soldiers in recent months, waiting in ambush for them.
Since January 2021, hundreds of soldiers and officers have reportedly been killed.
Two explosive-laden cars plowed into a military convoy in Wulgo, killing at least 33 soldiers.
Abu Bakr al-Siddiq and Bana Jundullah were identified as the suicide bombers. Four military vehicles, according to the organization, were also destroyed.
The rebels also killed roughly 20 soldiers in Malari, Borno State, in February.
Following solid intelligence, the soldiers went on patrol to remove some Boko Haram fighters in the area when they were ambushed by the gang.