Miller hit 53 not out off 35 balls to enable South Africa to overhaul Australia's total of 157 for nine with four balls to spare last night.
The hosts were in trouble at 95 for six but the left-handed Miller, playing on his home ground, steered them to victory with sensible batting interspersed with some powerful hits.
The key over was the 16th, which started with South Africa needing 45 runs off 30 balls. Miller hit two big sixes as Andrew Tye conceded 16 runs.
Australia made a fast start after winning the toss, racing to 69 for one in the six-over power play, with Aaron Finch pounding 40 off 27 balls.
More From This Section
He hit four sixes, three of them off the first three balls bowled by off-spinner JP Duminy, who was surprisingly brought on during the power play.
But the tourists lost their way against the medium-pace of David Wiese (two for 16) and the leg-spin of Imran Tahir (three for 21), slumping to 114 for seven.
South Africa made a bad start, losing AB de Villiers to the first ball. They slipped to 41 for three before captain Faf du Plessis (40) and Rilee Rossouw (19) put on 31 for the fourth wicket.
They were out off successive deliveries before man of the match Miller took charge.
"He played a gem of an innings," said Australian captain Steve Smith, who said Australia had put in a good performance in the field before Miller took the game away from them.
"Once again we won a game we probably shouldn't have won," said Du Plessis, who said South Africa had started badly with both ball and bat.
The three-match series is the last chance for both teams to decide on their combinations ahead of the World Twenty20 in India later this month.
Australia included two players making their Twenty20 international debuts -- wicketkeeper Peter Nevill and leg-spinner Adam Zampa.
South Africa surprisingly did not include fast bowler Dale Steyn, who was declared fit again after being out of action for more than two months with a shoulder injury.