Switzerland's desire to exit the tournament well shone through after the break, and after an extended bout of pressure with 20 minutes to go Eren Derdiyok's deft touch put Yakin through on goal and the striker blasted past Ricardo to spare the hosts the ignominy of finishing with no points.
Yakin then scored his and Switzerland's third of the tournament form the penalty spot after Fernando Meira fouled substitute Tranquillo Barnetta in the final ten minutes.
The result does not change Portugal's status as winners of Group A, but the break in their momentum may yet affect them in the quarter-finals.
Switzerland fielded the same outfield players that started their first two matches, while Portugal manager Luiz Felipe Scolari made eight changes to his first-choice side.