The video -- said to have been recorded in the IS-controlled Raqa province of northern Syria -- is one of the clearest such threats yet made by the Islamic State extremists against Turkey.
Ankara has for long been accused of not doing enough in the fight against IS fighters and even collaborating with the group, allegations it fiercely denies.
But Turkey last month finally carried out its first air strikes against the jihadists and opened one of its key bases to US forces for lethal attacks on IS targets.
In the video posted on YouTube entitled "message to Turkey", a bearded man speaking Turkish condemns Erdogan as a "heathen" who has "made friends" with the United States and the "atheists" of the separatist and staunchly-secular Kurdistan Workers' Party (PKK).
More From This Section
He said the west of Turkey would soon be in the hands of "the crusaders", a reference to the Americans, and eastern Anatolia controlled by the PKK.
The speaker urged Turks to show loyalty to the self-proclaimed caliph of IS -- Abu Bakr al-Baghdadi -- to help jihadists conquer Istanbul.
The speaker also called on the Turkish people "without losing time" to fight "against the atheists and all those who have made you slaves of these crusaders".