Home favorite Otto finished with an even-par 72 and a 14-under total of 274 for his second European Tour title.
Wiesberger shot a 4-under 68 during the final round at the Serengeti course. He had five birdies and a bogey.
After wobbling with bogeys at Nos. 13, 15 and 16, overnight leader Otto birdied the 17th and held on for his first tour win since the Italian Open in 2008.
"The first win is always the nicest win," said Otto, who grew up in nearby eastern Johannesburg. "But this one makes it special because it's our national open. You dream of these things ... you must enjoy it.
"The names that are on there (the trophy). You can be proud of it."
Searching for a third South African Open title, Goosen managed just two birdies and three bogeys in his final round to slip from a tie for second after the third round.
Otto started the final round three clear but struggled on the back nine and slipped into a tie with Wiesberger, who had already finished.
But Otto picked up a crucial birdie on 17 that gave him the lead again.
"I just got anxious," he said. "I hit some good putts that didn't go in. Even my caddie said to me 'Take it easy, we will make it.'"
The 35-year-old Otto won $210,000, which moved him into the top 60 in the Race to Dubai and qualified him for the season-ending Dubai World Championship.