Declan Kidney's side dominated territory early on and took advantage of ill discipline from the visitors to build a healthy half-time lead.
Jonathan Sexton proved prolific with the boot, scoring four penalties to send Ireland into the break 12-3 ahead.
South Africa responded in the second half and scored a quick try after JP Pietersen was released from the sinbin for a high tackle.
Ulster fly-half Ruan Pienaar did the damage, capitalising quickly from a loose ruck to dive over for the score.
Pat Lambie made no mistake with the conversion and added a penalty 10 minutes later, forcing the Irish to chase the game.
Ireland made a host of changes in the closing stages but were unable to mount a comeback against a powerful South African pack.