With the test locked at 15-15, Liam Williams was forced to evade the wandering fan as the Welsh winger attempted to outsprint the cover defence into the corner.
Soon after the Springboks won a penalty, kicking for the corner and scoring the match-winning try through hooker Malcolm Marx to secure a 23-18 victory.
The try was the only five-pointer of the match, helping the World Cup holders come from behind to record their first victory in Cardiff in eight years.