Ireland's homecoming to Lansdowne Road ended in frustration as they slumped to a fourth successive Test defeat after their late fightback fell just short.
Trailing 23-9 with 15 minutes to go, the appearance of Ronan O'Gara from the bench coincided with a scoring spree that almost reeled in the Springboks.
O'Gara, who was winning his 100th cap, teed up a try for Tommy Bowe with a crossfield kick and then supplied the scoring pass for Rob Kearney's touch down.
Presented with a touchline conversion to level the match, the Lions fly-half struck the crossbar and Ireland failed to trouble the scoreboard again in the remaining five minutes.
It was a rousing finish to an otherwise poor spectacle that did little to mask the shortcomings of a side that looked rusty and disjointed.
Aggrieved at having been written off in the build-up, underdogs South Africa were given all the ammunition they needed to make a triumphant opening to their grand slam tour.
Juan Smith and Gio Aplon ran in tries while Morne Steyn kicked nine points but the Springboks, who avoided a fourth straight defeat in the fixture, were hardly commanding.
For Ireland, their debut at the Aviva Stadium turned out to be deeply disappointing for reasons beyond the performance on the pitch.
Rows of empty seats greeted the teams at kick-off, a result of the ticketing fiasco that forced to Irish Rugby Football Union to issue an apology on Monday.
Forced to buy tickets in two-match packages, many supporters voted with their feet to deny the Aviva Stadium a sell-out for its first international event.
Even fewer were present for the second half with many spectators failing to return to their seats after the interval.
Those that had turned up for the match saw South Africa take an early lead when Steyn kicked a penalty to land his 39th consecutive shot at goal.
The Springboks were denied the chance to make real inroads by two thunderous tackles from Ireland, who were hunting runners in small groups.
Feeding off scraps in the opening 10 minutes, Ireland almost profited when Brian O'Driscoll chased down Cian Healy's fly-hack but full-back Aplon did a good job of clearing the danger.
Signs of rustiness were evident as Irish passes failed to stick and it was poor handling that enabled South Africa to extend their lead.
An Irish line-out saw Eoin Reddan attempt an ill-advised pass meant for Luke Fitzgerald but the lurking Juan Smith intercepted before completing the 65-metre race to the line, riding a tackle from Rob Kearney as he crossed the whitewash. Steyn converted.
It had been a poor opening 20 minutes from Ireland but they got off the mark when Jonathan Sexton landed a penalty, the fly-half having missed a very kickable chance moments earlier.
Worryingly for the green shirts, South Africa had established a comfortable lead without playing particularly well.
Ireland were still struggling to secure any possession, though at least their defence was holding up.
A promising and rare attacking move ended when Bowe gave Luke Fitzgerald a forward pass, summing up a disappointing first half.
The rain began to fall more heavily, resulting in both sides dropping passes, and the half finished with Steyn and Sexton exchanging penalties.
A rare sight greeted the Aviva Stadium shortly after the interval as Steyn missed his first shot at goal in 42 attempts.
Number eight Jamie Heaslip finally generated some momentum for Ireland with a bulldozing run, but South Africa secured the turnover.
Steyn proved his missed penalty was just an aberration as he slotted a third, but once again Sexton replied in kind in a cagey third quarter.
Steyn was inexplicably replaced by debutant substitute Patrick Lambie whose first act was to miss an easy penalty.
South Africa soon forgot the blunder, however, when Zane Kirchner performed a scissors with Aplon who cut inside Kearney and touch down under the posts with Lambie converting.
Ireland replied when Bowe grabbed O'Gara's crossfield kick - with the help of a kind bounce that wrong footed Aplon - to run in a try that rekindled Irish hopes.
O'Gara converted and a second try looked certain when Heaslip broke free down the left wing, but he ignored his support runners for too long.
The pressure continued, however, and a long pass from O'Gara fell to Kearney who raced in at the right corner.
O'Gara's conversion hit the right post and canny South Africa managed to stem the green tide in the final five minutes.