Argentina were leading 8-7 when flanker Marcos Kremer was sent off with an hour remaining, and played with 12 men for a time in the third quarter when both locks Matias Alemanno and Tomas Lavanini were sent to the sin bin.
Later, Scotland captain Jamie Ritchie and Argentina prop Thomas Gallo were yellow carded for fighting as tempers boiled over.
Incredibly, with 12 on the field and defending a five-metre scrum, the Pumas poached a dropped ball and Emiliano Boffelli, playing on his club home ground, ended up scoring between the posts at the other end and converting his try.
The Pumas trailed only 24-22 with nearly half an hour to go but it was too long to hold out.
Scotland added four more tries and wing Darcy Graham got a hat trick in their highest score against the Pumas.
Scotland also earned a measure of revenge for losing the series in Argentina 2-1 in July.
Five-eighth Finn Russell, who was not wanted on the tour, was the architect of the home side's eight-try performance.
Key in six of them was Russell who had initially been left out of the squad for the autumn internationals by Gregor Townsend, with his test career looking at an end.
He was brought back in an injury crisis and restored to the line-up against New Zealand last week.