England were set a target of 212 to win as Hashim Amla top-scored for South Africa with 43 before he was removed by Jade Dernbach.
James Anderson was South Africa's main tormentor, bagging four wickets for 44 runs in the low-scoring innings, as Dean Elgar also chipped in with 42.
England stuttered in reply, Ian Bell was trapped leg before wicket for 12 with Cook out for 20, but Eoin Morgan (73) and Jonathan Trott (71) steadied the ship and eased England to victory, with Samit Patel hitting the winning run.
"It's always nice to get a first win over South Africa in any form," said Cook. "There were a few nerves and on this wicket you couldn't take it to them too much. It was pleasing to cross the line and make it 1-1. A lot of character was shown out there. It was a really good bowling performance. All the lads fielded better and bowled better. You wouldn't want to chase more on the wicket. Morgan and Trott had good performances.
"We know what James Tredwell will do for us and Jade came in and took wickets for us at a crucial time. It's always nice when we don't let them build partnerships."
The win lifted England above South Africa and into top place of the International Cricket Council ODI Championship rankings. However, Cook played down talk of England's rise to the top.
He said: "It's so weird that we talk about it every game. It's nice to win and hopefully we'll have a good weekend at Lord's as well."
South Africa took first blood when they won the series opener at Southampton before the second match at Cardiff was washed out. The fourth ODI of the five-game series will be played at Lord's on tomorrow .
Morgan, the man-of-the-match whose 73 runs came off 67 balls, hopes his performance in the one-day game will boost his chances of a return to England's Test side in the absence of Kevin Pietersen.
"I've been in the side for a while now and I enjoy taking responsibility in the middle order. Hopefully I will be able to continue making contributions that will help us win games. I've spent six weeks in the IPL not playing so I've had plenty of time to work on my game there and work on my balance and my movement, front and back foot, and it's come up trumps so long may it continue and long may I continue scoring runs."
AB de Villiers, the South Africa captain, conceded his side did not master the conditions to set an imposing target for England. "It was a good toss to win but unfortunately we didn't take advantage. It was a decent wicket but we should have been looking at 250-odd runs. Most of our senior players got in but we didn't make it count."
Contextual targeting label: