With both teams starting the night in need of a first Group A victory, it was the Scots who took a first-half lead through James Morrison.
But hopes of a morale-boosting win were shattered in the second half when star man Gareth Bale won and converted a penalty, before snatching the winner with a minute to go.
The win sees Wales take their first points of the campaign and move above Scotland, who have just two points from three matches.
Bale told Sky Sports 1: "We needed it, it's a kickstart to our campaign, hopefully it can inspire us now for the matches ahead.
"We all knew coming in it was a massive game for us.
"We let ourselves down as well as the nation last time out.
"We went a goal down but we fought back like men and it was a great result."
As for the winning goal he said: "There was a bit of space in front of me, I drove into it and no one closed me down.
"Some go in and some don't."