Lopez double floors San Martin
Lopez struck twice with headers in the opening 15 minutes of the second half of Wednesday's match to leave Gremio on the brink of securing a quarter-final place.
Souza opened the scoring for the visitors in the ninth minute but Colombian striker Martin Arzuaga levelled in the 34th.
Gremio have twice won the Libertadores while San Martin have only existed since 2004 when the club was founded by the university of the same name.
Wednesday's other ties involving Mexican pair San Luis and Guadalajara were both postponed because of the flu outbreak.
The South American Football Confederation (CSF) ruled last week that the games would have to be played outside Mexico but both Colombia and Chile refused to act as alternative venues.