Fighting began on Monday morning when the army fell into an ambush, six soldiers were also injured and two militants were captured.
Thirty members of Boko Haram and five Nigerien soldiers have been killed in fighting in the southeastern Diffa region of Niger, the defense ministry said in a statement late on Tuesday.
The clash took place Monday near the village of Toumour, near Lake Chad and the Nigerian border, an area that has plagued by violence from the Islamist militant group and is under an extended state of emergency.
Boko Haram took the nearby town of Bosso in early June, in an attack that killed 32 soldiers and was the deadliest Boko Haram assault in Niger since April 2015. Since then, Chad has sent troops to help Niger wage a counterattack.
Fighting began on Monday morning when the army fell into an ambush, the statement said, adding that six soldiers were also injured and two militants were captured.
"The Boko Haram fighters were trying to prevent people from praying to mark the feast of sacrifice," said Laouan Boukar, a resident of Toumour, referring to the important Muslim holiday Eid al-Adha that was on Monday.
Boko Haram has been trying to establish an Islamic state adhering to strict Sharia law in northeastern Nigeria since 2009. About 2.1 million people have been displaced and thousands have been killed during the insurgency.