Swift ball from Stringer at the base of the Ireland scrum allowed O'Gara deliver the perfect crossfield kick for Tommy Bowe to gather and score under the posts and the Munster out-half, winning his 100th Ireland cap added the points.
Then with seven minutes remaining O'Gara again delivered the goods, Rob Kearney the beneficiary to score wide on the right, O'Gara's conversion coming back off the upright to deny Ireland a share of the spoils.
Ireland: Rob Kearney; Tommy Bowe, Brian O'Driscoll capt, Gordon D'Arcy, Luke Fitzgerald; Jonny Sexton, Eoin Reddan; Cian Healy, Rory Best, Tony Buckley; Donncha O'Callaghan, Mick O'Driscoll; Stephen Ferris, David Wallace, Jamie Heaslip. Replacements: Sean Cronin, Tom Court, Donnacha Ryan, Denis Leamy, Peter Stringer, Ronan O'Gara, Keith Earls.
South Africa: Gio Aplon; Bjorn Basson, Zane Kirchner, Jean de Villiers/Patrick Lambie, Bryan Habana; Morne Steyn, Ruan Pienaar; Tendai Mtawarira, Bismarck du Plessis, Jannie du Plessis; Bakkies Botha, Victor Matfield; Deon Stegmann, Juan Smith, Pierre Spies. Replacements: Chiliboy Ralepelle, CJ van der Linde, Flip van der Merwe. Keegan Daniel, Francois Hougaard, Adi Jacobs, Patrick Lambie.