Resident James Ularamu said civilian fighters held Gulak town on Sunday night until the military sent reinforcements who fought off the extremists.
The attack came as a military intelligence officer confirmed that 107 soldiers remain missing five days after a battle in which the rebels drove away in a T-72 tank. The officer spoke on condition of anonymity because he is not authorized to speak on the issue.
Nigeria's military has denied dozens of soldiers are missing, but it often does not report embarrassing information.