While Pandey remained unbeaten on 79 off 48 balls, veteran Dhoni made 52 off 28 deliveries.
The duo shared 98 runs for the fifth wicket in just 9.2 overs to take India to the commanding total.
Sent into bat, India were dealt a severe blow in the first ball of the second over when Rohit Sharma was caught plumb in front of the wicket for a duck by Junior Dala (2/28).
But thereafter, Shikhar Dhawan (24 off 14) came to the party and clobbered Chris Morris for two fours and as many sixes in the third over over to up the ante.
More From This Section
With his pacers going for runs, skipper JP Duminy brought himself on to the attack in the next over but was welcomed by Dhawan with an exquisite pull to the midwicket boundary.
Duminy, however, got his man in the next ball as Dhawan hit a full toss straight to Farhaan Behardien at mid-on.
India received a big blow in the next over when skipper Virat Kohli gloved a rising Dala delivery straight to Heinrich Klaasen behind the stumps.
But the dangerous-looking partnership was broken by Andile Phehlukwayo in the 11th over when he had Raina LBW.
After Raina's dismissal, Pandey and Dhoni mixed caution with aggression to take India forward.
The duo took time to settle down but once they got their eyes set, they clobbered the South African bowlers to all around the park.
While Pandey struck six boundaries and three sixes during his knock, Dhoni was not far behind his younger partner as he found the fence four times and over it thrice.