Chasing 312, Australia lost half their wickets for 65 runs and had no answer against Kagiso Rabada (3-33), Marco Jansen (2-54) and Keshav Maharaj (2-30) as they folded for 177 in 40.5 overs with Marnus Labuschagne (46) their only top-order batsman to fire.
South Africa's win was built on a platform provided by De Kock, who made 109 while Markram hit a handy 56 to help the Proteas post 311-7 in 50 overs.
Australia were left bemused by a couple of decisions taken by the TV umpire following reviews as Marcus Stoinis was deemed caught behind despite his bottom hand appearing to be off the bat as the ball hit his glove.
Steve Smith had earlier been adjudged out lbw with ball-tracking technology predicting the delivery would have hit the top of his stumps, but the batsman looked unconvinced.
Rabada removed both batsmen to leave Australia tottering on 70-6 before South Africa's spinners put them out of their misery as Tabraiz Shamsi (2-38) cleaned up the tail.
"It's a great win for the boys," said player of the match De Kock. "To be honest, we didn't know how the wicket was going to play. We assessed conditions well and played accordingly.
"We knew it was going to be a difficult game for us. But as long as we played and stuck to our strengths... that's what we did and came out on top."
Asked to bat first after Australia captain Pat Cummins won the toss, South Africa made a watchful start and rode their luck before De Kock picked up where he left off in the win over Sri Lanka with eight fours and five sixes in his 106-ball knock.
South Africa skipper Temba Bavuma (35) gained two reprieves as Australia failed to hold onto difficult chances before Glenn Maxwell (2-34) snared him, but the Proteas marched on as De Kock twice hit Josh Hazlewood into the stands in the 23rd over.
Spinner Adam Zampa removed the dangerous Rassie van der Dussen (26) but De Kock continued to plunder runs and brought up his 19th ton by pulling Cummins for a huge six shortly after the pace bowler had dropped Markram when he was on one.
Maxwell bowled De Kock out with one that crept through after hitting the left-hander's bat as he attempted a reverse pull and Markram fell to Cummins after a breezy knock, as the Australian bowlers put the brakes on South Africa's scoring.
Cummins could have had two more wickets but Marcus Stoinis and Mitchell Starc put down chances on a sloppy day in the field but a double strike by Starc (2-53) in the last over kept South Africa from swelling the score.
"If we've got to be challenging for this tournament you've got to find a way in all conditions," Cummins said after their second straight defeat in the tournament.
"That's for the bowlers to take wickets and the batters to try and get runs. Not much needs to be said tonight, everyone's hurting so we've got a few days, we'll regroup. We'll try and make amends."