Italian Gavazzi won a bunch sprint to close out the event after a 154.7km trek from San Luis to Juana Koslay.
Diaz stayed out of danger however, with the Argentine finishing 33 seconds ahead of Tejay van Garderen (BMC) in general classification.
It was a sweet win for Diaz in front of his home fans as he went one better than last year when he finished second in GC to American Levi Leipheimer
Stage seven result
1 Mattia Gavazzi (Ita) Androni Giocattoli 3:25:48
2 Peter Sagan (Svk) Cannondale Pro Cycling
3 Francisco Jose Ventoso (Spa) Movistar Team
4 Maximiliano Richeze (Arg) Lampre-Merida
5 Bartiomiej Matysiak (Pol) CCC Polsat Polkowice
1 Daniel Díaz (Arg) San Luis Somos Todos 20:37:28
2 Tejay Van Garderen (USA) BMC Racing +33
3 Alex Diniz (Bra) FUNVIC +39
4 Alberto Contador (Spa) Saxo - Tinkoff +1:02
5 Jurgen Van den Broeck (Bel) Lotto +1:47