Switzerland failed to hold onto their lead, which came through Hakan Yakin in the 32nd minute.
Substitute Semih Senturk equalized for Turkey 12 minutes after restart before Arda Turan gave them a priceless win in the dying seconds.
The result means that Portugal, who have six points from two games, guaranteed their quarter-final berth as Group A winners.
Turkey and Czech Republic, both with three points, will meet in a decisive match which will determine who will book the second quarter-final ticket.
Switzerland will not make it beyond the group stage after suffering two successive defeats.
Turkey keeper Volkan Demirel blocked two fierce drives from Yakin and Tranquillo Barnetta midway through the first half.
However, he was unable to prevent Turkey from conceding the opener in the 32nd minute.
Striker Eren Derdiyok, 19, latched onto a clever pass in the right hand side of the penalty area before rounding Demirel.
He then squared to Yakin at the far post as the Young Boys striker slotted into an empty net from two yards.
Senturk brought Turkey level in the 58th minute when he rose unmarked to head home Nihat's inch-perfect cross from the left.
Yakin should have restored Switzerland's lead six minutes from time after a swift counter attack.
Gokhan Inler burst into the area before passing to Yakin, whose low shot was blocked by Demirel. The Fenerbahce guardian also blocked the follow-up.
Turan gave Turkey a precious win in stoppage time when his deflected shot from 25 yards looped over Switzerland keeper Diego Benaglio and into the net.