The Sharks wing dashed over for a pair of silky tries that were out of keeping with the quality in the rest of the contest, with only a late disallowed score denying Argentina a famous win.
South Africa, which starts its Rugby World Cup campaign against holder New Zealand on 21 September, caused a surprise by winning the recent Rugby Championship ahead of the All Blacks, Australia and Sunday's (AEST) opponent.
This was its final home Test before going for global glory in Japan, and it was a tough contest, with coach Rassie Erasmus seeing his side given plenty of trouble by the Pumas.
His Boks had won 46-13 in Salta when they travelled to Argentina for last weekend's Rugby Championship finale, but this never looked like being a similarly one-sided match.
Led by hooker Schalk Brits, who at 38 years and three months became South Africa's oldest first-time captain, South Africa was often sluggish
Elton Jantjies booted South Africa ahead in the 18th minute but Argentina responded in kind through Joaquin Diaz Bonilla.
Nkosi skipped in down the right for his first try, with a stylish shuffle of his feet before darting for the line. Jantjies rattled the post with the conversion attempt.
Argentina hit back right at the end of the half with an interception try, Guido Petti seizing on a loose pass from Cobus Reinach to run in from halfway. Diaz Bonilla added the extras and the Pumas held a 10-8 half-time lead.
Nkosi produced a sparkling run and dived over for his second try, taking the aerial route to avoid a last-ditch Pumas tackle.
But there was plenty of mileage left in the contest, with Diaz Bonilla and Jantjies exchanging penalties before Pablo Matera pounced for a try from a lineout by the Boks line.
Jantjies kicked another penalty to nudge the hosts 21-18 in front yet Argentina looked to have won it when Lucas Mensa charged through to touch down late on.
An earlier obstruction on Vincent Koch resulted in the try being disallowed, to South Africa's relief, and Jantjies added the resulting penalty to secure a narrow win.