South Africa posted a below-par 158 for four in their 20 overs as Australia strangled their bright start, but were able to defend the total as the wicket slowed up and the touring side found scoring increasingly difficult.
SCORECARD: South Africa vs Australia
Warner was unbeaten on 67 from 56 balls and having reached 98 for one in the 13th over, Australia looked odds-on for the victory until South Africa found a way to cut off the boundaries and they finished short on 146 for six.
The series is level at 1-1 with the decider to be played in Cape Town on Wednesday, after which the sides will contest three one-day internationals.
Captain Quinton de Kock was again the mainstay of the South African innings, his clean striking bringing five fours and four sixes in a fine 70 from 47 balls before he holed out to mid-off.
Rassie van der Dussen (37 from 26 balls) provided a vital contribution, but South Africa were 20 or so runs short of where they should have been, having scored only 36 runs in the last five overs with wickets in hand.
Seamer Kane Richardson was the pick of the visitors bowling attack with 2-21 in four overs.
Australia appeared to be cruising in their reply and when Steve Smith (29 from 26 balls) was out with the score on 98, they required 61 from 45 balls with eight wickets remaining.
But South Africa used the slow wicket expertly as leg-spinner Tabraiz Shamsi returned figures of 0-17 in his four overs to increase the pressure on the visitors.
Australia needed 20 from the final 12 balls and when Kagiso Rabada’s penultimate over went for only three, they were firmly on the back foot and never recovered momentum.