Duncan Weir scored a late penalty to see off Argentina as Scotland secured their third consecutive Test win under new head coach Vern Cotter.
Stuart Hogg and Javier Ortega Desio traded tries before Nicolas Sanchez's drop-goal gave the Pumas the lead.
The hosts took charge after the break through the boot of Sanchez and Joaquin Tuculet's try.
But, after a try from Henry Pyrgos went unconverted, Weir held his nerve to kick his third successful penalty.
Cotter's inexperienced side, captained for the first time by Grant Gilchrist, started shakily but grew into the game thanks chiefly to Hogg.
It was the Glasgow Warriors back who registered the first score of the game after six minutes. Nick De Luca's excellent pass sent Tommy Seymour scampering down the left and he fed Hogg to go over in the corner. Weir converted.
Seymour went close again a few moments later, following his own kick down the left, only to be denied by a bad bounce.
That escape seemed to rouse Argentina. Santiago Iglesias sparked a counter-attack on the right and, after a great spell of possession, Desio dived over on the left. Sanchez was unable to add the extras.
While Argentina were having all sorts of problems at their own line-outs, Scotland repeatedly fell short in the final third and were punished when Sanchez slotted a delightful drop-goal just before the half hour.
With the hosts ahead for the first time, the fly-half began to boss proceedings. His pin-point work with the boot paved the way for a period of dominance for the home side, even if they were unable to capitalise on their territorial advantage.
On the night he became Scotland's most capped hooker, Ross Ford helped steady the ship, but the visitors passed up the chance to take a lead into the break when Weir's penalty drifted narrowly wide.
Sanchez would make no such mistake a couple of minutes into the second half, sliding over a penalty to extend Argentina's lead to 11-7.
A Weir penalty chipped away at the advantage, but that was soon cancelled out when the Scots gave away another penalty for failing to release at the breakdown and Sanchez scored from the halfway line.
The hosts extended their lead when replacement Tuculet showed a great turn of pace to scamper over. On this occasion, though, Sanchez could not convert.
With Scotland nine points adrift, a huge kick from Weir brought them within a converted score with little under 10 minutes to play.
Replacement Pyrgos reduced the arrears to 19-18 following fine work by De Luca and Seymour down the left, but Weir missed the chance to give his side the lead.
It seemed like that Scotland's best opportunity might have gone, but the Glasgow Warriors fly-half landed a 78th-minute penalty, amid a chorus of boos from the home fans, to nudge the Scots into a 21-19 lead.
Sanchez had one last chance to give Argentina the win, but his last-gasp drop-goal attempt was not quite good enough.
Argentina: L Gonzalez Amorosino, S Cordero, M Orlando, S Gonzalez Iglesias, M Montero, N Sanchez, T Cubelli (capt); B Postiglioni, J Montoya, M Diaz, M Carizza, M Alemanno, R Baez, JO Desio, T De la Vega,
Replacements: S Iglesias Valdez, L Noguera Paz, N Tetaz Chaparro, T Lavanini, A Ahualli de Chazal, M Landajo, M Moroni, J Tuculet.
Scotland: S Hogg, S Maitland, N De Luca, P Horne, T Seymour, D Weir, G Hart; A Dickinson, R Ford, G Cross, J Gray, G Gilchrist (capt), R Harley, B Cowan, K Low.
Replacements: P MacArthur, G Reid, J Welsh, T Swinson, C Fusaro, H Pyrgos, T Heathcote, D Fife.