Kohli made 112 —extending his record of centuries in one-day run chases to 20 — and Rahane scored 79 as India reached the winning target of 270 with 27 balls to spare.
"It was quite special," said Kohli. "The first game of the series is always important and we wanted to take the confidence of the last Test into here."
India to pace-off against South Africa
Kohli, who now has 33 one-day centuries, said he enjoyed batting in a chase. "It's easier. You can break down a total when you have a number on the board, you know exactly what you want to do against each bowler. It suits my game plan."
The India captain praised Rahane after their partnership took India to within 14 runs of victory before both fell to catches in the deep. "He capitalised on that number four spot which we have been wanting to sort out for a while now," said Kohli.
India ended a sequence of 17 successive home wins by South Africa and comprehensively outplayed the team that went into the match as the top-ranked one-day international team.
Debutant Ngidi runs through India in 135-run victory
Second-ranked India controlled most of the match despite a century by South Africa captain Faf du Plessis.
India's decision to pick two wrist spinners paid off as Yuzvendra Chahal and Kuldeep Yadav shared five wickets and were mainly responsible for restricting South Africa to 269 for eight.
Du Plessis made 120 off 112 balls but it was only late in the innings that South Africa were able to lift their scoring rate on a slow pitch after slumping to 134 for five in 27.5 overs.
Du Plessis shared partnerships of 74 with Chris Morris and 56 with Andile Phehlukwayo for the sixth and seventh wickets.
"Those two wrist spinners have been the difference for us," said Kohli. "Breaking that middle order was very crucial."
Leg-spinner Chahal took two for 45 and left-arm wrist spinner Yadav took three for 45.
Du Plessis admitted: "We didn't bat well enough. India bowled really well and we were 50 to 70 runs short."
He said of the Kohli-Rahane partnership: "We tried everything but Virat and Rahane played really well and had all the answers."
Kohli made his runs off 119 balls with ten fours, while Rahane struck five fours and two sixes in an 86-ball innings.
There was a scare for India early in the South African innings when Kohli jarred his left knee when attempting a sliding stop on a soft outfield.
He left the field twice to receive treatment. He said he had also strained his groin. "I'm fine for now," he said.
Du Plessis reached his ninth one-day international century off 101 balls with 11 fours and added two sixes before being caught at long-off in the last over after a 112-ball innings.
Du Plessis left the field with a finger injury during India's innings but said he expected to be fit for the remaining five matches.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ