Guptill done 101 not out from 69 balls, smashed the last ball of the match from Rory Kleinveldt over cover for four to allow New Zealand to reach a target of 169 in a match condensed to 19 overs a side because of a power failure.
The result leads New Zealand to level the three-match series with the decider match to be played at Port Elizabeth on Wednesday. Martin Guptill missed his side's eight-wicket crush in the 1st match in Durban on Friday because of a stomach ailment, but the opening batsman produced his value to the team on Sunday by slamming six sixes and eight fours.
Guptill became the second New Zealand Cricketer, after captain Brendon McCullum, to made a hundred in a Twenty20 international.
South Africa scored 165 runs for five after a floodlight failure spoiled a 50 minute delay. South Africa were 128 for two after 16.1 overs when the lights on one of four towers went out. Henry Davids scored 55 runs and captain Faf du Plessis made 63 runs for his team. New Zealand seam bowler Doug Bracewell claimed three wickets in four balls in the last over, all from catches in the deep, to finish his spell with three for 33. Martin Guptill named for the Man of the Match award for his last ball century.