The attack took place on the outskirts of the northeastern city of Maiduguri - the birthplace of the Boko Haram armed group.
Abdul Mohammed of the State Emergency Management Agency told The Associated Press news agency that another 17 people were wounded in the explosions early Wednesday.
Coordinator Abba Aji of the civilian self-defence Vigilante Group said one bomber blew up inside the mosque and the second outside as survivors tried to flee.
Aji said the mosque is in Umarari on the outskirts of the city that is now the command centre of the Nigerian military's war against Boko Haram.
While there was no immediate claim of responsibility, blame will likely fall on the insurgents.
Boko Haram has increasingly used suicide and bomb attacks as Nigeria's military pushes the group out of territories they once controlled. Several bombers have exploded themselves in recent months at roadblocks into the city manned by the military and vigilantes.
The US military calls Boko Haram the most violent armed group in the world.
Some 20,000 people have been killed and about 2.3 million displaced since it started its violent campaign in 2009.
Children have been particularly targeted by Boko Haram and have often been the victims of sexual abuse, forced marriage, and abductions.