Markram (93), David Miller (63), Marco Jansen (47) and Andile Phehlukwayo (39no) all took turns in setting the scoreboard alight at the Bullring on Sunday after the Proteas were sent in.
Adam Zampa (3-71) bounced back from his nightmare in Centurion - where he conceded an ODI record 0-113 - to mastermind a mini-collapse of 4-23 before Phehlukwayo cut loose late, belting Michael Neser's last four balls of the innings for 6, 6, 6, 4.
The Proteas' day started poorly when captain Temba Bavuma was run out for a duck when hit in the ribcage by Sean Abbott and unable to beat Marnus Labuschagne's direct hit at the non-striker's end.
Quinton de Kock (27), playing his last home ODI after announcing he will retire after the World Cup, fell to a sharp Cameron Green catch at slip and walked off to a standing ovation.
Rassie van der Dussen fell for 30 before Zampa exacted some revenge for Centurion, bowling his tormentor, Heinrich Klaasen, for six.
Markram and Miller added 109 for the fifth wicket before the shock gamble to introduce Tim David's gentle offspin in the 41st over paid off, with the part-timer's first delivery in ODIs seeing Markram hole out to Michael Neser.
David dropped a sitter when Jansen was on 18 and the towering South African went on to smash his career-best knock off just 23 balls.
Zampa was on a hat-trick when he bamboozled Gerald Coetzee and Keshav Maharaj before Phehlukwayo's late salvo.
Meanwhile, injured Australian opener Travis Head will return home for further medical review on his fractured left hand before a final call is made on whether he will play in the World Cup.
Australia have until September 28 to finalise their 15-player World Cup squad, leaving Head in a race against time to recover from the blow he took from Coetzee in the fourth ODI.
Uncapped Matt Short has been called up to replace Head in Australia's three-match series against India, starting in Mohali next week, where captain Pat Cummins, Steve Smith, Mitchell Starc and Glenn Maxwell will return from injury.