Lee (14-6) stroked a two-run, bases-loaded single to cap off a six-run third inning and also hit his first career triple in the fifth. Chase Utley, who also drove in four runs, hit a long three-run homer in the third.
On the mound, Lee allowed two runs while scattering eight hits and walking none, at one point retiring 11 straight en route to winning his fourth consecutive decision. He is 4-0 with a 2.05 ERA in his last six starts and 5-1 with a 2.29 lifetime ERA against Miami.
Philadelphia has won six in a row over Miami.
In his first major-league start, Sam Dyson (0-1) allowed seven runs.
ROCKIES 6, CARDINALS 2
DENVER (AP) Todd Helton started his final homestand with a key single in the eighth inning as the Rockies beat the Cardinals.
Charlie Blackmon had three hits and drove in three runs for the Rockies, who prevented the Cardinals from taking over sole possession of first place in the NL Central. They remained tied with the Pittsburgh Pirates, who lost 2-0 to San Diego.
Matt Carpenter and Matt Adams had two hits each for the Cardinals.
Helton was playing in front of Colorado fans for the first time since he announced his plans to retire at the end of the season, his 17th. He received a standing ovation when he came to the plate in the first, and Cardinals starter Lance Lynn stood behind the mound and waited as the crowd saluted Helton.
BREWERS 6, CUBS 1
MILWAUKEE (AP) Caleb Gindl had three hits, including a two-run home run, as Wily Peralta pitched six strong innings to lead the Brewers to a win over the Cubs.
The Brewers' fourth win in five games moved them 3 games above Chicago at the bottom of the NL Central.
Peralta (10-15) gave up an unearned run on five hits. He struck out seven while walking two.
Edwin Jackson (8-16) lasted only four innings for the Cubs, giving up two runs on two hits and three walks. Jackson has the most losses of any pitcher in the NL. Peralta is second with 15.
DIAMONDBACKS 2, DODGERS 1
PHOENIX (AP) Paul Goldschmidt hit a two-run home run in the first inning and Trevor Cahill and three relievers made it stand up in Arizona's win over Los Angeles.
Goldschmidt raised his NL-leading RBI total to 116 with his 33rd home run off Dodgers starter Ryu Hyun-jin (13-7). Goldschmidt has homered in each of his last two games after an 83 at-bat drought.
With Los Angeles' fourth loss in a row and the Diamondbacks third straight win, the Dodgers' magic number to clinch the NL West remains four.
Ryu (13-7) went the distance for his second complete game, allowing only the two runs on two hits in eight innings. He walked one, struck out four and retired 23 of the final 24 batters he faced.
Cahill (7-10) won for the fourth straight decision, holding Los Angeles to one run on two hits over 5 2-3 innings.