The visitors turned in a muscular performance, particularly in the second half after the Scots had led 10-8 at the interval.
However, for all the disappointment there was pride for home skipper Stuart Hogg who equalled the Scotland international tries record with a superb brace.
Here’s how the captain, and his Scotland team-mates rated in the penultimate match of the series.
Player ratings scale - 10: One of the best performances you've seen. 9: Outstanding. 8: Very good. 7: Good. 6: Average. 5: Poor, 4: Very poor. 3: A terrible day at the office. 2: Abysmal. 1: One of the worst performances you've seen.

. EDINBURGH, SCOTLAND - NOVEMBER 13: South Africa adn Scotland Line up's during the Autumn Nations Series match between Scotland and South Africa at BT Murrayfield, on November 13, 2021, in Edinburgh, Scotland. (Photo by Paul Devlin / SNS Group)
South Africa and Scotland line up during the Autumn Nations Series match at BT Murrayfield. (Photo by Paul Devlin / SNS Group) Photo: Paul Devlin - SNS Group

. Pierre Schoeman - 6
Toughest test yet for the Edinburgh loosehead and he relished the battle but Scotland were distinctly second best in the scrum. 6/10 Photo: Steve Welsh

. Stuart McInally - 6
Scotland struggled in the set-piece and it was a difficult game for the hooker in what was his first start for Scotland in a year. 6 Photo: Steve Welsh

. Zander Fagerson - 6
Tough old shift for the prop as South Africa freshened up their front row on the stroke of half-time. Photo: Ross Parker - SNS Group / SRU

. Grant Gilchirst - 6
Carried well but lineout battle was tough for the Edinburgh man. His clean catch helped set up the move for Hogg’s second try. Photo: Craig Williamson - SNS Group / S

5. Jamie Ritchie - 6
Moved to openside to accommodate Haining. A lively presence but was guilty of conceding too many penalties. Photo: Ross Parker - SNS Group / SRU

6. Matt Fagerson - 8
The Glasgow No 8 is unlikely to face much tougher tests but stuck to his task for the full 80. 8 Photo: Ian MacNicol

7. Ali Price - 6
Kept trying to spark the Scotland attack but was tough going against defensively sound opponents. Photo: Stu Forster

8. Finn Russell - 7
Architect of Scotland’s first try with a delightful cross kick. Always ready to take the game to South Africa but limited opportunities. Photo: Paul Devlin - SNS Group