The attack on the prison at Diffa, near the border with Nigeria, occurred between 0000 and 0100 GMT, a humanitarian source said.
"They killed a captain of the prison guard and three of the attackers died," the source said, adding that they "came on foot" and were probably trying to free some Boko Haram members held in the prison.
Two other jail guards were injured, the source said. The attackers were dressed in army uniforms and had grenades and assault rifles.
In June, 38 civilians were killed -- including 14 women and 10 children -- in a Boko Haram attack targeting two villages close to Diffa.
More From This Section
Troops from Niger, Chad, Nigeria and Cameroon have been fighting Boko Haram insurgents for several months and have claimed a string of successes but the group has recently stepped up strikes, especially suicide bombings, in Nigeria and its neighbouring countries.
Boko Haram's deadly insurgency, which erupted in northern Nigeria, has killed at least 15,000 people since 2009 and left more than 1.5 million homeless.
The local private Anfani radio station reported that there was an intense gun battle at the prison for at least an hour. It said the three dead attackers all wore belts packed with explosives.
Boko Haram staged a failed raid on Diffa prison in February.