MOSCOW — President Vladimir V. Putin of Russia and his Turkish counterpart, Recep Tayyip Erdogan, are expected to reconsider their dispute over Syria at a meeting on Tuesday in St. Petersburg, with both leaders interested in a public display of affection to show the West that strained ties have not left them isolated.

While Mr. Erdogan has long insisted that Syria’s president, Bashar al-Assad, will need to cede power before any peace deal can be discussed, Russia’s success on the battlefield, backed by Iran, may have altered the calculus.

Mr. Erdogan’s visit to Russia, his first venture outside his country after a failed coup last month, is draped in symbolism because Turkey’s relationships with the United States and the European Union have eroded significantly.

There is a deepening sense in Turkey that its Western allies have failed the solidarity test, given the threat to its existence posed by the July 15 coup attempt. Turkish officials are frustrated that Western capitals have focused on Mr. Erdogan’s purge of tens of thousands of military officers, civil servants and journalists as a worrying sign of his drift toward authoritarianism.