South Africa's fifth loss of 2017 has seen them fall one place to sixth in the latest World Rugby Rankings with Scotland the beneficiaries.
The Springboks fought back from a slow start that left them 21-3 down after 34 minutes with tries from Warrick Gelant (pictured), Handre Pollard and Jesse Kriel giving them a one-point lead going into the last quarter of the match.
However, Leigh Halfpenny's penalty 12 minutes from time gave the home side a 24-22 victory.
Saturday's victory was worth 1.1 rating points for Wales, but that was not enough to lift them from their position of sixth.
However, what was a near four-point deficit to South Africa before kick-off has been slashed to a little over one point after tries by Scott Williams and debutant Hadleigh Parkes (2).
RWC 2019 Tickets
RWC 2019 Official Ticketing site NOW LIVE
Fans can now register interest to apply for Rugby World Cup 2019 tickets