De Villiers lifted South Africa after they had slumped to 17-2 and 35-3 in reply to New Zealand's moderate total of 253-9, and guided the visitors to victory with 28 balls to spare.
The skipper scored his 106 off the exact same number of balls. He shared a 90-run fourth wicket partnership with JP Duminy who overcame a difficult beginning to make 46 from 74 balls, and the pair stemmed the tide for South Africa after the loss of Hashim Amla for eight, Graeme Smith for nine and Jacques Kallis for 13.
South Africa were 125-3 when Duminy was out and de Villiers then settled into a steady partnership with Far du Plessis which kept the visitors well ahead of the required run rate.
Du Plessis (66 from 49 balls) blasted nine fours and one six in an innings which forced New Zealand onto the defensive, reaching his half century with a six off Doug Bracewell immediately after de Villiers had reached his century.
While Du Plessis went for the long ball, De Villiers aimed to accumulate steadily, hitting only three fours and four sixes while 51 of his runs came from singles. He continually found gaps in the New Zealand field, which left his Black Caps opposite Brendon McCullum with few options to halt the flow of runs.
"A solid performance by the boys," De Villiers said. "We did really well in the field to restrict them to 250-odd.
"They had a couple of partnerships going but they didn't extend it and that's where we won the game. We kept picking up wickets at the right times."
De Villliers said Duminy's steadying knock was vital, laying the foundation for the captain and Du Plessis to chase down the runs.
"JP struggled a bit early on. He didn't hit the ball as sweetly as he wanted to but he played a vital knock to extend the innings and we didn't lose wickets at the wrong times.
"We left it late enough for Faf to come in and play an impact innings. He did extremely well, went better than a run a ball and supported me really well."
Earlier, McCullum took advantage of second and third chances to top score with 56 in his team's total of 253-9 from 50 overs.
McCullum was twice given out, including to the first ball of his innings, and twice had those decisions reversed by replays, allowing him to play a key role in New Zealand's low-key batting effort.
Coming in at first drop, McCullum was judged lbw first ball when he played no shot to a delivery from Lonwalu Tsotsobe (2-41) and was struck on the pad. He challenged the decision and television replays showed the ball bouncing over the stumps.
McCullum had moved on to 3 and New Zealand were 43-1 when he was given out caught by De Villiers, off the bowling of left-arm spinner Robin Peterson. McCullum called for the review and again replays proved he was not out.
McCullum went on to reach his 21st half century in one-day internationals from 62 balls and with two fours and two sixes. He put on 79 for New Zealand's third wicket with Kane Williamson before being caught by Peterson off the bowling of Kallis in the 30th over when New Zealand was 137-3.
Williamson (55) then became New Zealand most effective run-gatherer, givinge some impetus to an innings which was otherwise restricted by accurate and varied South African bowling.
He reached his half century from 59 balls before falling in the 41st over when New Zealand were 194-5.
"I thought 250 was competitive but we'd have to bowl exceptionally well and looking back in hindsight one of us needed to go on and get a hundred as AB did," McCullum said.
"It was a little bit short with the bat, probably. We had the foundation to be able to launch later on and get that 270-280 total and if we'd got that, taking those first three wickets in a hurry we were more than competitive."