Zarif met with Turkish Foreign Minister Mevlut Cavusoglu in an unscheduled trip to Ankara on his way back to Tehran from a visit to New York for the UN General Assembly, a Turkish diplomatic source told AFP.
They discussed bilateral and regional issues, including the Syrian conflict, the source added.
Zarif was later due to meet with Turkish Prime Minister Binali Yildirim, the premier's office said.
Turkey has launched an unprecedented operation inside Syria, with the aim of cleansing its frontier of terror groups including Islamic State (IS) jihadists.
More From This Section
Ankara is also pressing for a safe zone inside its war-torn neighbour to shelter refugees.
Despite the differences over Syria -- and Ankara's increasingly close relationship with Tehran's arch rival Saudi Arabia -- the two countries have worked hard in the last months to preserve a strong relationship.
Tehran was swift to voice support for Turkish President Recep Tayyip Erdogan after the attempted coup, winning praise from Ankara for its rapid reaction.
Cavusoglu made a surprise visit to Tehran in mid-August, after Zarif held talks in the Turkish capital the same month.