Aguero, on from the start with Carlos Tevez benched in a revamped forward line, netted seconds from half-time yesterday after the hosts had dominated the opening stages.
With Lionel Messi magnificently pulling the strings just behind the main strikers, Atletico Madrid star Aguero made the points safe with a second goal seven minutes after the restart to take his tally at the event to a tournament-high three.
Di Maria then finished off the outclassed Ticos with the third just after the hour mark as Argentina joined Group A winners Colombia, Chile, Peru and Venezuela in the quarters.
"This was a real tonic - just what we needed," said Aguero.
"We played very well and got the goals - but the main thing was we gelled as a team. Now we have to keep it up."
Javier Pastore, a late substitute for the profligate Gonzalo Higuain, who could have at least doubled the margin, agreed.
"That was a really important win and a good team performance - our attitude was spot on," he said.
Coach Sergio Batista was under huge pressure to deliver a win and secure passage to the next round with the hosts seeking their first major trophy since 1993.
And after their slow start he rang the changes with Tevez and Ezequiel Lavezzi benched and Higuain brought in as a classic centre forward allowing Messi to concentrate more on his string pulling out of the immediate firing line.
Where Messi in particular was concerned, the plan worked like a dream, as the Barcelona man was involved in almost every move, tearing Costa Rica's defence to shreds with his incisive passing and weaving in and out.
Argentina''s revamped forward line lay siege to Leonel Moreira's goalmouth from the outset, with Real Madrid''s Higuain firing a snap shot well wide on the turn before Messi, having hit the woodwork with a freekick, drove just over.
Aguero then drilled a low effort just past the post as the one-way traffic continued before Messi went off on a run down the right, only for Aguero to blast off target after taking his through pass.
Again, world player of the year Messi, facing huge popular criticism for his country's poor start following draws with Bolivia and Colombia, ran at the Costa Rican defence, finding Higuain, who drove wildly over from barely ten yards out.
But the dam had to burst and it finally did seconds before the interval.