Kurt-Lee Arendse’s early try and the boot of Handre Pollard gave the Springboks a 13-8 half-time lead over the Irish, whose try came from debutant Jamie Osborne.
Wing James Lowe had a try disallowed before Cheslin Kolbe extended the hosts’ advantage midway through the second half.
Conor Murray’s late score kept Ireland in touch, but a penalty try with 90 seconds remaining was enough to hold on to the win despite Ryan Baird’s last-gasp consolation.
O’Mahony said that there were “positives” for Ireland to take in the defeat but his side would analyse where they could improve ahead of the second Test in Durban.
“There are a lot of positives to take out of our performance but little bits here and there, playing against a side as good as this, they are going to punish you.
“We’ll go and have a look, fix a few things and look forward to next week.”