Turkey inflicted France's only defeat of their Group H campaign so far back in June and proved the world champions' nemesis again on Monday.
Substitute Olivier Giroud's 76th-minute header looked to have wrapped up France's qualification with two matches to spare, but it was not to be for Didier Deschamps' side.
Hakan Calhanoglu's free-kick teed up Ayhan for a close-range finish and France will now have to wait until November to claim their spot at next year's finals.
France would have capped a dominant start if not for Turkey goalkeeper Fehmi Mert Gunok, who spread himself to deny Antoine Griezmann before brilliantly keeping out Moussa Sissoko's follow up.
Sissoko – who also went close with a header early on – had another opportunity in the 24th minute as France continued to threaten, but his snapshot failed to trouble Gunok.
Griezmann soon took matters into his own hands with a wonderful, curling effort from the edge of the box, yet despite beating Gunok, his strike inched wide of the upright.
France wanted a penalty when Griezmann went down under Merih Demiral's challenge, but the referee waved play on – Burak Yilmaz blazing over at the other end after a swift Turkey counter.
Deschamps turned to Giroud in the 72nd minute and the striker swiftly justified the change, heading home Griezmann's corner at the near post.
The hosts could not hold on, however, as Turkey substitute Calhanoglu provided a wicked cross for Ayhan to nod in and secure a share of the spoils.
What does it mean? France made to wait
France should still have little trouble in qualifying, though this draw has allowed Iceland – who beat Andorra – to close the gap between themselves and the top two to four points.
Turkey sit top courtesy of an improved head-to-head record, and will book their place at the Finals should they avoid defeat against Iceland next time out.
Giroud the main man for France
Chelsea forward Giroud has spoke of his frustration at being second choice behind Tammy Abraham at Stamford Bridge, but proved his worth to France once more with his superb cameo.
If only Deschamps had started the former Arsenal striker – who is France's top scorer in 2019 – from the off, things may have been very different.
Ben Yedder fails to walk in Giroud's boots
Without Giroud, Les Bleus lacked a focal point up top, with Ben Yedder hardly testing Demiral or Caglar Soyuncu.
Moldova and Albania are France's final two qualification opponents in November, while Turkey host Iceland before travelling to Andorra.