The hosts held a slim 48-run lead with Kane Williamson and BJ Watling at the crease.
Dimuth Karunaratne thwarted a tiring New Zealand bowling attack to score his maiden test century.
Dimuth Karunaratne and Kaushal Silva safely guided their side to 84 without loss in their second innings.
AB de Villiers will captain SA in the opening game at the WACA on Friday.
South Africa beat New Zealand by 72 runs and took a 2-0 lead in the ODI series.
South Africa are among the favourites to win thequadrennial tournament.