In recent months, the military has suffered its heaviest defeats in years, commanders have been repeatedly replaced, and special forces soldiers have mutinied.
The militants attacked the village of Mailari in the Guzamala region of Borno state about 2:00 am, according to the survivor, Abatcha Umar.
He said he had not been able to tell whether they belonged to Boko Haram or to ISWA.
Mr Umar said he had counted 19 people killed, including his younger brother.
An aid worker at a camp that received the survivors, and who declined to be identified, put the death toll at 63.
The Islamist militants had been spotted around the village three days before their attack, said Mr Umar.
Locals had warned Nigerian troops stationed in the nearby town of Gudumbali, but no action was taken, he said.
The aid worker said hundreds of people from villages in the area had fled to the camp for displaced people where he worked, in Monguno, reports abc.net.