It was the second victory in as many days for Astana after Pello Bilbao's in the opener, with Lopez's coming on the145km 'Queen' stage from Lavarone to a steep summit finish on l'Alpe di Pampeago.
"Our team did a good race as my teammates provided me with a very strong support during the whole day," Lopez said.
"Also, on the final climb I had many teammates around me, so I felt safe in the leading group. The climb was super hard, and I am happy to win today.
"I know, this is a very famous climb with a huge cycling history, so, it is an honour for me to follow the way of the big champions.
"I was happy to see [team-mate] Jan Hirt attacking from the group, it was a good try for him. Later, I tried just to control the situation, preparing for the final kilometre.
"It looked like we were coming for an uphill sprint, so I saved some energy to do my best in the final meters."
The leading trio on the stage also occupy the top three spots on the general classification but with Sosa in front of Pinot and Lopez and only six seconds separating them.
Team Sky's Chris Froome crossed four seconds behind Lopez as he continues his preparations for next month's Giro d'Italia and is also fourth overall at 16 seconds.
“I think I’m in a great position considering my main objective for this first part of the season is to be ready for the Giro. I think I’m on track for that and I’m happy with how I’m feeling," Froome said.
“I’m racing as hard as I can and I’m not going to give up just because I came fourth today. There’s still a lot to race for.
"Astana has shown that they are very strong and they have a great team here as well. So I expect they will do everything they can to control the race now. But there are a lot of people who still want to race so it’s going to be an exciting next few days hopefully.”
The third stage covers 138.3km from Ora to Merano with three major climbs before a 25km race to the finish.