Chris Coleman earned his first win as Wales manager after the Scots - also searching for their first victory in Group A - had taken the lead through James Morrison in the first half.
But man of the match Bale had the final say when he won and converted a controversial second half penalty, before grabbing a stunning long-range winner with a minute to go.
Before he struck, Scotland and star comeback man Steven Fletcher were denied a goal when a linesman ruled that a cross from Charlie Adam had gone out of play.
Levein's team now have to travel to group leaders Belgium on Tuesday with points urgently needed.
Midfielder Darren Fletcher returned to the Scotland team for the first time in almost a year as captain. As well as the skipper - who had been sidelined by a chronic bowel complaint - striker Fletcher and Celtic winger Kris Commons were also back in the side after considerable absences from international football.
The trio's inclusion was among five changes from the Scots' 1-1 draw with Macedonia last month, with Danny Fox and the fit-again Scott Brown the other men being brought in.
There was a new captain for the hosts too as centre-back Ashley Williams assumed the armband from midfielder Aaron Ramsey to lead a Dragons team that showed four adjustments from their 6-1 drubbing in Serbia.
In place of injured goalkeeper Boaz Myhill and defender Adam Matthews, Lewis Price and debutant Ben Davies came into the team, along with midfield pair David Vaughan and Joe Ledley.
Scotland looked the more composed side in the very early exchanges, but Wales soon found some rhythm and Bale sent a dipping effort off-target from distance in the seventh minute.
The Tottenham man tried his luck again three minutes later, latching on to Chris Gunter's lofted ball down the right channel, cutting in and bending a shot across Allan McGregor that went just wide.
The best Scotland could muster in response was an Alan Hutton effort that went over, before Ramsey teed up Joe Allen for a strike that Gary Caldwell managed to bock.
Wales then had the clearest chance yet to open the scoring when Bale crossed for Steve Morison, who could only head wide.
Within seconds, the ball had been sent downfield where Steven Fletcher beat Williams to flick it on for Morrison, who smashed it past Price.
The Dragons went in search of a reply and, after Bale had struck a free-kick too high, Allen shot wide.
Steven Fletcher could then only scuff his attempt when the ball came to him from Fox's delivery.
Davies was next to hit one wide for the Welsh and Ramsey sent the ball over before Morrison did likewise at the other end from Steven Fletcher's knock-down.
After Price tipped away a ball swept into the box by Hutton three minutes into the second half, Wales were dealt another blow when Ramsey was booked for a foul on the Scotland full-back, meaning he misses the next game.
The Arsenal midfielder's luck did not improve as he went down in the box under a challenge from substitute Charlie Adam, only to see the referee wave play on.
Morrison suddenly found himself in space and fired at Price, with the goalkeeper pulling off a good save.
Ramsey then advanced towards goal but failed to finish as McGregor came out to meet him.
The Scots thought they had doubled their lead when Steven Fletcher bulleted a header into the back of the net with 15 minutes remaining.
But the assistant referee deemed Adam's cross had swerved out of play and the effort was disallowed, although television pictures suggested this may not have been the case.
Wales were back on level terms with 10 minutes to go when Maloney was deemed to have fouled Bale in the box, who got up and rifled past McGregor from the penalty spot.
Hutton then fired just over as the Scots searched for a late winner but the honours went to Wales instead with a minute to go when Bale curled a stunning left-foot shot past McGregor to claim a last-gasp win.