Wicketkeeper-batsman De Kock hit 112 from 135 balls from the top of the order as the Proteas finished on 266 for five.
Dale Steyn then claimed career-best figures of five for 25, as he effectively derailed Pakistan's pursuit with three wickets in the 47th over.
De Kock had not managed to pass 40 in his 14 limited overs internationals, but brought up his century by thumping seven-foot quick Mohammad Irfan over his head for six in an otherwise gritty innings.
Opening partner Hashim Amla was the next highest scorer, adding 46, but the Proteas failed to fully cash in on their start.
It looked like that might prove costly as half-centuries from debutant Shaoib Maqsood and Misbah-ul-Haq had set Pakistan on pace to run down the target, with 45 needed from the final six overs.
But Steyn's clatter of wickets irretrievably swung matters his side's way as he removed set duo Umar Akmal and Misbah before shattering Saeed Ajmal's stumps in a devastating over.
Pakistan slumped to 238 all out from 49.2 overs, to hand South Africa a 3-1 lead with only the final match in Sharjah on Monday to play.
After De Kock's patient innings formed the basis of South Africa's total, the Pakistan openers also opted for caution early on.
Ahmed Shehzad (43) and Mohammad Hafeez (33) pieced together a 74-run stand in 19 overs that was undermined by three qucik wickets.
The pair fell in the space of 12 balls, Shehzad brilliantly run out by AB de Villiers, before Asad Shafiq managed just one to leave his side 86 for three.
Maqsood and Misbah both passed 50 to turn the game Pakistan's way, even when the debtant became Steyn's first victim - caught by De Villiers over his head at mid-on.
Misbah remained, however, and with Umar they whittled the asking rate down to just over a run a ball.
But Steyn's return to the attack in the 47th over ended all plans as he made his triple strike.
Earlier, three wickets at the start of the final 10 overs - including a tiring De Kock who hit a full Junaid Khan ball to Misbah - slowed the momentum of the proteas innings after an 87-run opening stand.
The Proteas had reached 198 for two heading into the final 10 overs, but any immediate acceleration was put on the skids as De Villiers, De Kock and David Miller all departed in the space of 20 balls.
JP Duminy and Ryan McLaren ensured panic did not set in, however, as they bided their time before taking 37 from the final three overs.
Both cleared the ropes in the penultimate over, which cost the normally frugal Ajmal 15 runs.
- Sports & Recreation
- Dale Steyn