J.D. Martinez also drove in two runs and James Outman added a solo shot in the ninth inning for the Dodgers (89-57), who reduced their magic number to two to clinch the National West League title for the 10th time in the past 11 seasons.
Eugenio Suarez homered for the Mariners (81-66), who had a two-game winning streak snapped and missed a chance to make up ground in the American League West after both Houston and Texas lost. Seattle remained a half-game ahead of Toronto for the AL's third and final wild-card playoff berth.
Dodgers rookie Bobby Miller (10-3) went 5 2/3 innings to earn the victory. The right-hander allowed three runs on six hits, with two walks and seven strikeouts.
Evan Phillips pitched the ninth for his 23rd save of the season.
Mariners right-hander George Kirby (10-10) took the loss, giving up four runs on five hits over six innings, with two walks and seven strikeouts.
The Mariners opened the scoring on Suarez's solo shot down the left field line with one out in the bottom of the fourth.
The Dodgers took the lead in the top of the fifth as Jason Heyward led off with a single to right and, two outs later, Rojas lined a high fastball just over the left field wall and into the visiting bullpen.
The Dodgers extended the lead to 4-1 in the sixth as Will Smith was hit by a pitch with one out and scored on Max Muncy's triple into the right field corner. Martinez lined a single to center to bring home Muncy.
The Mariners pulled within a run in the bottom of the inning. Julio Rodriguez led off and lined a single to left. After a walk to Cal Raleigh, both runners advanced on a wild pitch. Teoscar Hernandez lined a single to left to score Rodriguez and send Raleigh to third. Suarez grounded into a double play, bringing home Raleigh to make it 4-3.
The Dodgers added a run in the eighth after Freddie Freeman was hit by a pitch to start the inning. Freeman stole second and took third on catcher Raleigh's throwing error, then scored on Martinez's two-out single to right.
—Field Level Media