The home side, chasing England's 270 for five and hoping to level the seven-match series at 1-1, looked firm favourites on 263 for five and needing eight to win off fast bowler Kabir Ali's final six balls.
The match seemed settled when Ali bowled a full-pitch no-ball with his first delivery which Mark Boucher [ Images ] pulled for four.
Boucher was caught off an identical shot next ball and Ashwell Prince [ Images ] was run out but South Africa still only needed one run off the final delivery with the scores tied.
All rounder Andrew Hall [ Images ] missed it, however, and was stumped by wicketkeeper Geraint Jones, standing up, as the home side ended on 270 for eight, sparking huge celebrations among the England fielders.
Ali's first seven overs had cost 49 runs.
"It was a tough night for Kabir but that was a special last over under pressure," said Marcus Trescothick [ Images ], who stood in as captain after Michael Vaughan [ Images ] was sidelined by a bad stomach after batting.
Gibbs passed 5,000 runs in one-day international cricket but the home side still needed 82 off the last 10 overs and 36 off five.
Gibbs fell to a fine catch by Darren Gough at backward square leg off Matthew Hoggard [ Images ] but Justin Kemp, Boucher and Shaun Pollock [ Images ] waded with some big hitting at the death before their hopes were dashed by Ali.
Earlier, powerful right-hander Kevin Pietersen [ Images ], born in South Africa before moving to England to improve his chances of international cricket, scored an unbeaten maiden century, finishing on 108 from 96 balls.
Many of the spectators, in an orchestrated move, had turned their backs on Pietersen as he walked back to the pavilion after his innings.
Pietersen came in with England struggling on 67 for three and he and Vaughan consolidated with a stand of 80 off 110 balls.
Vaughan was watchful in scoring his 42 off 82 deliveries, before he was run out by AB De Villiers [ Images ] attempting a second run to third man.
Paul Collingwood [ Images ] made a brisk 40 in a partnership of 92 with Pietersen, whose unbeaten 108 included six fours and two sixes.
England go into the third game of the seven-match series on Friday in Port Elizabeth still leading 1-0.
M.Trescothick b Pollock 37
G.Jones c Ntini b Nel 20
M.Vaughan run out 42
A.Strauss c Boucher b Hall 2
K.Pietersen not out 108
P.Collingwood c de Villiers b Ntini 40
I.Bell not out 11
Extras (lb-3 w-5 nb-2) 10
Total (for five wickets, 50 overs) 270
Did not bat: A.Giles, K.Ali, D.Gough, M.Hoggard.
Fall of wickets: 1-52 2-60 3-67 4-147 5-239
Bowling: Pollock 10-1-52-1, Ntini 10-0-51-1 (w-2), Nel 10-0-54-1, Hall 10-0-50-1 (nb-2), Smith 2-0-10-0 (w-2), Kallis 4-0-24-0 (w-1), Kemp 4-0-26-0.
G.Smith c Jones b Hoggard 25
A de Villiers c sub (V.Solanki) b Ali 20
J.Kallis c Trescothick b Giles 63
H.Gibbs c Gough b Hoggard 78
J.Kemp b Gough 32
M.Boucher c Giles b Ali 15
S.Pollock not out 17
A.Prince run out 0
A.Hall st Jones b Ali 0
Extras (b-4 lb-6 w-5 nb-5) 20
Total (for eight wickets, 50 overs) 270
Did not bat: M.Ntini, A. Nel
Fall of wickets: 1-47, 2-51, 3-185 4-237 5-239 6-268 7-269 8-270
Bowling: Gough 10-0-49-1 (w-2), Hoggard 10-1-42-2 (w-2), Ali 8-0-56-3 (nb-5), Collingwood 10-0-42-0, Giles 8-0-46-1 (w-1), Trescothick 4-0-25-0.
Result: Match tied.