Guptill smashed six boundaries and three maximums off 35 deliveries before being caught by David Miller off the bowling of Farhaan Behardien (1-4) as New Zealand posted 177 for seven after winning the toss and electing to bat first.
The Black Caps then restricted the hosts to 145 for eight with Behardien posting a top score of 36 off 27 balls.
Tom Latham (three) did not last long, being trapped in front by Eddie Leie (3-0-32-1) but then Guptill and South Africa's World Cup nemesis, Grant Elliott (20), added 34 runs in just 3.2 overs to give the visitors some momentum heading into the second half of the innings.
Behardien managed to dismiss Guptill with a full toss before Colin Munro (18) and James Neesham (28) threatened to send the Black Caps over the 200-run mark but Rabada claimed the wickets of Munro and Neesham in consecutive deliveries to end a 20-run stand which came off eight balls.