López (2-3) stopped a three-start losing streak. The right-hander, who had not gone more than 5 1/3 innings, held the Indians without a hit until the sixth and was not charged with an earned run in 6 1/3 innings.
Miami closer Sergio Romo worked the ninth for his third save, completing a three-hitter as the Marlins improved to 2-5 on the road.
Alfaro's homer triggered Florida's three-run fifth off Ramírez (0-1), who came in after Carrasco hurt his left knee while covering first base.
The Indians have lost three straight, and now have concerns about Carrasco.
He was lifted after four innings with a bruised left knee sustained when the right-hander landed hard scrambling to catch Carlos Santana's errant throw. Carrasco took several warmup pitches, and seemed to talk his way into staying in to finish the inning before being replaced by Ramirez.
Not wanting to take any chances, manager Terry Francona pulled Carrasco.
It's the latest injury for the 32-year-old, who has missed significant time in previous seasons with assorted injuries - many of them unlucky.
The Indians said Carrasco was removed because of "discomfort" and his absence will put further stress on Cleveland's rotation, which is already missing Mike Clevinger because of a back strain.
Lopez had been shaky in his prior three outings, but the right-hander was sharp against the Indians, whose offense continues to sputter.
Cleveland didn't get its first until the sixth when José Ramírez lined a one-out single to right. However, López got out of the inning as second baseman Starlin Castro ranged to his left to grab Santana's grounder, pivoted to throw back to second and force Ramírez, and the Marlins turned the stylish double play.
Alfaro connected on a grooved fastball from Ramírez to open the fifth, when the Marlins also got an RBI double from Curtis Granderson and Martin Prado's sacrifice fly.
Marlins: LHP Jarlin García went on the paternity list and the club recalled LHP Jose Quijada from Triple-A New Orleans. Quijada has not appeared in a major league game.
Indians: OF Bradley Zimmer is making slow progress from a strained oblique sustained in training camp. Manager Terry Francona said Zimmer is close to taking "live swings" at the team's year-round complex in Goodyear, Arizona.
Indians RHP Jefry Rodríguez (0-1, 3.18 ERA) will be recalled from Triple-A Columbus to make his second start and face Marlins rookie RHP Sandy Alcantara (1-2, 5.09), who has not allowed a home run in 23 innings this season.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.