A synagogue, two churches and a police checkpoint were targeted in the cities of Derbent and Makhachkala. Twelve other officers were wounded.
A Russian Orthodox priest has also been killed and four attackers shot dead, state media report. The hunt for more gunmen is still ongoing.
The assailants have not been identified, but Dagestan has in the past been the scene of Islamist attacks.
Footage on social media shows buildings on fire in both cities.
In another video, people wearing dark clothes are seen shooting at police cars, before a convoy of emergency service vehicles, sirens blaring, arrive at the scene in Makhachkala, Dagestan's largest city.
In Derbent - home to an ancient Jewish community - gunmen attacked a synagogue and a church. Local security officials say both buildings were set ablaze.
An unofficial channel on the Telegram messaging app, Mash, said gunmen were barricaded in a building in Derbent.
Russia's Investigative Committee said it had launched an investigation over "acts of terror", AFP news agency reported.
In April Russia's FSB security service arrested four people in Dagestan suspected of involvement in the attack on Moscow's Crocus City Hall venue the previous month.
More than 140 people were killed in that attack, which was claimed by the Islamic State group.
Between 2007 and 2017, a jihadist organisation called the Caucasus Emirate, and later the Islamic Emirate of the Caucasus, staged attacks in Dagestan and the neighbouring Russian Republics of Chechnya, Ingushetia and Kabardino-Balkaria.