The world body and two security sources initially said four people were killed in the attack in the remote town of Rann on Thursday evening but later revised the death toll.
Rann is located some 175 km east of the Borno state capital, Maiduguri, near the border with Cameroon and communications are difficult.
A UN spokeswoman in Abuja, Samantha Newport, said the attack happened “after dark” outside a camp housing some 55,000 people displaced by the conflict.
“Of the aid workers that were killed, two worked for the IOM (International Organization for Migration) in camp management; and one was a medical doctor working as a third party consultant for UNICEF,” the UN children’s agency, she added.
Three aid workers were injured and a female nurse was missing, feared abducted. All those killed, injured or missing were Nigerian.
The UN’s humanitarian coordinator in Nigeria, Edward Kallon, said: “Aid workers put their lives on the line every single day to provide emergency assistance to vulnerable women, children and men.
“Our deepest condolences go to the families of the victims and our brave colleagues and we call on authorities to ensure the perpetrators are brought to justice and account.”
There was no immediate confirmation of deaths or injuries among internally displaced people (IDP) but a civilian militia source in Rann and a senior military figure in Maiduguri said eight soldiers were killed.
Thursday’s attack in Rann comes nearly two weeks after Boko Haram kidnapped 110 schoolgirls from the town of Dapchi in neighboring Yobe state.
The government in Abuja said Friday the hunt for the missing students had been “extended to neighboring countries,” after reports some may have been taken into Niger.
The kidnapping and continued attacks in the region have raised questions about the extent of the Nigerian government’s claims to have virtually defeated Boko Haram.
Early on Friday, a female suicide bomber blew herself up near a mosque in Buni Yadi, Yobe state, civilian vigilante leader Ibrahim Liman told AFP from Maiduguri.
“From all indications it was a premature explosion... She died and she injured two worshippers who were heading to the mosque,” he said.
Buni Yadi is 45 km south of the Yobe state capital Damaturu. It was the scene of another Boko Haram school attack in February 2014, when at least 40 boys were killed.
The town was cleared of Boko Haram in March 2016.
Boko Haram’s quest to establish a hard-line Islamic state in northeast Nigeria has left at least 20,000 dead and made more than 2.6 million others homeless since 2009.
The military has regained the upper hand but the militants have increasingly turned to kidnapping for ransom as a way to finance their operations and win back key commanders in prisoner swaps with the Nigerian government.
In Rann, Boko Haram fighters “in large numbers” were said to have targeted troops protecting the IDP camp.