"[Alvarez has] become very consistent, and he's won ballgames," Marlins manager Mike Redmond said. "You do that by going out there and logging the innings and throwing strikes and keeping your team in it. He's definitely done that."
Mike Dunn logged the final out of the eighth inning, and Steve Cishek worked around two singles to seal Miami's 16th shutout. The save was Cishek's 38th save in 42 chances.
Ed Lucas had an RBI single, and Casey McGehee lifted a sacrifice fly to pick up a depleted offense, which is now without center fielder Marcell Ozuna, who is resting a high right ankle sprain.
The way both starters were breezing along, a little bit of support went a long way.
"Even when we've had our struggles, [Alvarez] is the guy we look at to be our stopper, for lack of a better term," McGehee said. "We feel like he's going to go out there and really shut down the other team, even if their best guy is going. When he's on, he's one of the best out there."
The Marlins also moved 4 1/2 games ahead of the Phillies, who are last in the National League East.
Alvarez is now at 180 innings, and he is scheduled to face the Nationals in the season finale on Sunday at Washington. A year ago on closing day, the right-hander no-hit the Tigers.
Alvarez was efficient, limiting Philadelphia to five hits and one walk before he exited after issuing a two-out walk to Carlos Ruiz in the eighth inning.
"I wanted to finish the game, but that at-bat with Ruiz, he fouled off a lot of pitches and got my pitches up, and Red took me out," Alvarez said. "I was thankful I was able to go close to finishing."
The Marlins strung together three straight one-out singles in the fourth inning to break through off Hamels. Jeff Baker got it rolling with a single to center, and Jarrod Saltalamacchia slapped a hit through the hole at short into left. Lucas' single to center, which was just out of shortstop Freddy Galvis' reach, drove home Baker.
The Phillies had runners in scoring position in the second and fifth innings, but Alvarez was able to escape each time. With runners on the corners in the second, Alvarez struck out Hamels to retire the side. And in the fifth, Hamels lined a two-out double to center, but Philadelphia was unable to capitalize. Alvarez got Ben Revere to tap to second.
"I'd say for the most part, [Alvarez has] given us a tough time this year," Phillies manager Ryne Sandberg said. "He's good with his live fastball. He's got some body action out there that has some deception to it. Overall, he's pitched good against us."
Alvarez was at 67 pitches through five innings.
Miami manufactured a run in the fifth inning with some nice situational hitting. Christian Yelich doubled to left over the head of Domonic Brown. Playing the percentages, Donovan Solano dropped a sacrifice bunt, and McGehee lifted a sacrifice fly to right field, adding an insurance run.
Taking the series opener was a relief after being swept in four-games by Washington.
"It's important that I have a strong end to the season," Alvarez said. "It's unfortunate we've come up short the last four games; we weren't able to win the close games. It was important to put a strong game out there and get the win."