Spain's Lopez began slowly and trailed 5-2 but he recovered strongly to take the first set before Coric, seeded seventh, clawed his way back to force a decider.
The 21-year-old Coric switched gears to go 5-4 up in the third set but could not prevent a dogged Lopez from securing victory in two hours and 45 minutes.
World number 71 Lopez next takes on Germany's Mischa Zverev or Filip Krajinovic of Serbia.
Rublev continues fine run with easy win over Lopez
Briton Kyle Edmund also sealed his place in the next round with a 3-6 6-1 6-2 win over Germany's Peter Gojowczyk. The fifth seed fired 13 aces to progress in one hour and 31 minutes.
Russia's Karen Khachanov powered past American Sam Querrey 6-4 6-4.
Top seed Juan Martin del Potro of Argentina, bidding for his third title of the season, begins his campaign against Spain's Albert Ramos-Vinolas on Tuesday.
Djokovic on brink of matching Sampras' year-end No 1 record after beating Coric
Edmund's losing run continues in Cologne