Two police officers and a woman were among the wounded, according to Shuvalov.
The shooter targeted a group of people celebrating a religious Russian folk festival and injured five others.
The Takfiri Daesh terrorist group claimed responsibility for the attack on the Telegram messaging app.
Four women were killed at the scene, and another woman died later in a hospital.More news: European Union ties Brexit transition talks to divorce agreement
More news: Man killed in shooting along St. Charles Avenue parade route, police say
More news: Bush indicts Russian Federation of meddling in 2016 USA presidential election
The RBK website quoted a local priest as saying the attacker opened fire as worshippers were leaving an afternoon service.
Dagestan is a predominantly Muslim region between Chechnya and the Caspian Sea. "A bearded man ran toward the church shouting "Allahu Akbar" [God is great] and killed the people". The gunman, who was carrying a hunting rifle, bullets and a knife, was killed. "I believe God saved us, not allowing the man to get inside the church", a witness told RT.
The motive for the shooting is yet to be ascertained. ISIS has claimed credit for the attack.
It has claimed a number of attacks on police in Dagestan in the last couple of years that have involved guns and explosives, as local security forces battle a simmering Islamist insurgency.