Scotland took a first-half lead through James Morrison, before a Steven Fletcher goal was harshly disallowed.
Gareth Bale then sparked the comeback when he converted from the penalty spot with 10 minutes to go, before securing the win with a stunning strike in the final minute.
Morison said: "Thank god for Gareth Bale, eh? It was fantastic. As soon as he got the ball, we were all screaming 'shoot' because it seems he can do no wrong at the minute. It was a fantastic goal.
"I always thought we had a chance. We were the better team from start to finish.
"We should have won a lot more comfortably. As long as we win the games, it doesn't matter."