The hosts went into the break a goal down, through a clinical finish by Marhan Jalil, for the visitors.
South Africa staged a comeback in the second period, with Wade Paton scoring the equaliser in the 59th minute, and Taine Paton netting the winner in the 70th minute, to claim a 1-0 lead in the four Test series.
Earlier, Julian Hykes won a turnover 30 metres out and fed Craig Haley, the South African striker getting in a backhand shot which Malaysian keeper Rozlan Jamaluddin parried away.
Then, in the right-hand corner, attacking halfback Lance Louw took a self-pass, free-hit and slipped the ball to striker Miguel da Graca, who won a penalty corner.
Jonty Robinson injected the set-piece, Tim Drummond trapped the ball and captain Austin Smith’s low drag-flick whistled past the near post.
Two minutes later, in the seventh, Clint Panther laid off a great square pass to Robinson, who had time, but who fired his shot past the far post.
At the other end, Malaysia’s first foray into the strike zone was cleared by defender Francois Pretorius.
The pace settled somewhat and Malaysia made another inroad into the danger zone before a midfield tussle for possession ensued in the next 15 minutes.
Malaysia found their feet leading towards half-time, but South African debutant Taylor Dart made a confident start, and striker Pierre de Voux was thwarted only by a superb tackle.
Abdul Sukri made an electrifying burst down the left wing which South Africa did well to stop.
With 30 seconds left, Pieterse blocked Nabil Fitri’s shot from close, but it was desperate for South Africa after all their good work, as Jalil buried the rebound into the backboard for 1-0 at half-time.
South Africa won their fourth penalty-corner with 11 minutes left on the clock, and this time Wade Paton, on the slip-pass left, was not to be denied, and his shot found the target for the equaliser (1-1).
With time running out, South Africa broke out of defence, and Taine Paton nailed the winner with 17 seconds left to seal a memorable 2-1 victory.