Oosthuizen carded a final round 68 for a 12-under-par total of 276, one stroke ahead of compatriot Branden Grace.
The 2010 Open champion looked to have blown his chances when he recorded a bogey on the 16th to fall a shot behind Grace, but back-to-back birdies in the final two holes put him in front.
Overnight leader Tommy Fleetwood of England managed a par round of 72 on Sunday to finish two shots behind Oosthuizen and tied third with Dutchman Joost Luiten.
Oosthuizen was at a loss to explain his early January form, other than the fact it follows a period away from his clubs.
"I think I just take a proper holiday," Oosthuizen said at the presentation ceremony.
"I didn't play any golf before this, so maybe that's the key."
A dropped shot on the 16th, where he had triple-bogeyed in Saturday's third round, was followed by a superb tee-shot on 17 that set up a birdie chance and give him momentum going into the final hole.
"I saw Branden was top of the leaderboard just as I was about to tee-off on 17, so I knew I needed to give myself a good opportunity so luckily the wind was at the left so I could take the pin on a bit. I still didn't think I would get that close," Oosthuizen said.
"I felt really comfortable out there all day, especially with my iron play and the putter behaved today, I hit some good putts. I managed to finish strong."
Oosthuizen said the 6689-yard course was suited to both the longer hitters and those who played a shorter game.
"I love the course, there weren't a lot of drivers for me this week, more like a lot of three woods, a lot of two irons. But that's what I love about the course, anybody can come and play here."
- Sports & Recreation
- Branden Grace