Garrett Cooper, Jazz Chisholm Jr. and Jorge Soler hit home runs for Miami.
The Marlins, who played their second home game of the season with the retractable roof open at loanDepot Park, will attempt a sweep of the three-game series Thursday.
Lopez (5-3) gave up four hits, walked three and struck out six, ending a winless drought since May 7.
''I had some great plays behind me and then the guys came through giving me the support,'' Lopez said. ''Those are the little things that make you realize it's a team effort. It hypes you up to go out and compete.''
Cooper's two-run homer capped a four-run third against Chad Kuhl (4-5) and put Miami ahead 4-1. Jon Berti hit an RBI triple and scored on Chisholm's single before Cooper connected on a drive that cleared the center field wall for his fifth homer.
''He got me out on sliders in the first inning, I fell behind and I had a feeling he was coming with a sinker,'' Cooper said. ''I just put a good swing on it, not try to do too much That's how you get in trouble.''
Chisholm's two-run homer and Soler's solo drive off reliever Austin Gomber in the seventh padded Miami's lead.
The early All-Star vote leader among NL second basemen, Chisholm said he welcomed manager Don Mattingly resting him in the series opener Tuesday. Chisholm began the day on a 2-for-16 funk with eight strikeouts.
''Sometimes you need that personal day,'' Chisholm said. ''He gave me a day off to get my mind cleared. Be ready for today and go out and ball.''
The huge lead and Lopez's lengthy outing also allowed Mattingly to rest his high leverage relievers.
''Pablo was nice, he was a little rough early,'' Mattingly said. ''But he got smoother and got better as the game went. It was good to see him get through seven.''
Colorado narrowed the gap on Elias Diaz's three-run homer off Louis Head in the ninth.
Kuhl was lifted after five innings. The right-hander allowed six hits, walked two and struck out three. He has lost five of his last six decisions after going 3-0 in April.
Colorado threatened in the sixth after Rodgers led off with a triple. But Lopez struck out Charlie Blackmon and C.J. Cron and retired Ryan McMahon on a flyout.
''With the heart of the order coming up, that was a little frustrating,'' Rockies manager Bud Black said. ''Their guy got us. We couldn't make contact so that's frustrating for sure. You need to do a little better job of situational hitting.''
The Marlins are 1-1 in the two games played with the roof open. Lopez also was the starter in the previous game not requiring the roof and had a no decision in Miami's 2-1 loss against Milwaukee May 13.
Rockies: LHP Ty Blach (left wrist sprain) is scheduled to make rehab appearances with Triple-A Albuquerque Wednesday and Saturday. ... Black said INF-OF Kris Bryant (lower back strain) felt good after his rehab game with Triple-A Albuquerque on Tuesday. There are plans to increase Bryant's innings workload with the minor league club before he rejoins the Rockies.
Marlins: LHP Jesus Luzardo (left forearm strain) has begun his throwing program. ... RHP Edward Cabrera (right elbow tendinitis) postponed his rehab outing at Triple-A Jacksonville on Wednesday because of a personal issue.
LHP Kyle Freeland (3-5, 4.46) will start the series finale for the Rockies on Thursday afternoon. LHP Braxton Garrett (1-2, 4.85) will start for the Marlins.
More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP-Sports
Copyright 2022 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.