The Swiss held firm against last year's finalists for most of the game and handed their rivals only their second home loss in almost 20 years and their first in Spain since 2018.
Cristiano Ronaldo's side will reach the final four with at least a home draw in Tuesday's crunch game against Spain, who must win in Braga to qualify for the semifinals.
Switzerland are third on six points, two above than Czechs who they will face on Tuesday in a battle to avoid relegation.
"They pressed well and are physically strong. They prevented us from playing our game, Spain coach Luis Enrique said. "We started the second half better and right after we equalised, they went back in front. It's never easy to beat Switzerland.
"We have to continue to work. We have to improve. I like the faith the team has shown. Now we have a final against Portugal."
Akanji opened the scoring with a header from a corner in the 21st minute, but Jordi Alba equalised for the hosts with a cross-shot from a counter-attack 10 minutes after the break.
Three minutes later, however, Embolo got the winner with a close-range strike from a corner.
Despite having 70% possession, Spain lacked energy for most of the match and barely posed a threat to Yann Sommer's goal until Alba scored with their first shot on target.
"It's a pity about tonight," Alba said. "We didn't play well in the first half. We did the most difficult thing which was to find the equaliser but they went back in front in a strategic play.
"Switzerland are a great team. They defend well. Now all we can do is beat Portugal on Tuesday to reach the final four of the Nations League. We have to continue."
ESPN's Adriana Garcia contributed to this report.