First-year San Francisco manager Gabe Kapler had to use five pitchers to keep his club on a roll and got another big night from the offense.
"We have guys that can hit the ball out of this ballpark, out of other ballparks," Kapler said. "One of the things that we continue to say and that we've seen play out is that we're not out of games so we can handle an early deficit and trust that we have the guys who can hit singles but also hit balls in the gaps and sometimes in the seats."
J.P. Crawford drove in three for the Mariners.
Ruf's blast off lefty reliever Anthony Misiewicz (0-2) was his third of the season and the fourth of his career as a pinch-hitter. Ruf, in his first year back in the majors after playing three seasons in Korea, was called on to hit for Dickerson, who homered off right-hander Brady Lail in the third.
"It's a lot of fun mainly because most of the time it's not going to work out that way where you're going to get a home run from the left side and then Ruf's going to come in and pinch hit and hit a big home run," Kapler said. "That just doesn't happen that frequently, so when it does work out in your favor you remember how often it goes the other way."
Dickerson, who was questionable before the game after fouling a ball hard off his right knee on Monday, praised Kapler for the move.
"That was awesome," Dickerson said. "To make a move and the guy immediately does the best thing you can do and hits a home run . it was awesome production."
Dubon also homered off Lail.
Seattle manager Scott Servais was ejected in the eighth inning by home plate umpire John Libka for arguing balls and strikes.
"The first one was definitely low and the second one was lower than that," Servais said. "Got to be better."
Giants starter Logan Webb allowed five runs and six hits in five innings.
Mariners starter Ljay Newsome was knocked out of the game after getting hit near the wrist on his pitching hand by a 100 mph line drive from Brandon Crawford leading off the second. The ball ricocheted off Newsome's hand high into the air and was caught by Crawford at shortstop for an out. Newsome grimaced and repeatedly tried to flex his hand before Servais and a team trainer came out.
"Actually feels pretty good right now. I have full motion in it," Newsome said. "I've been hit plenty of times but I've never come out of a game."
The Giants recalled OF Luis Basabe from the alternate training site in Sacramento and optioned IF Daniel Robertson down.
Mariners: Newsome underwent X-rays which were negative. He is day to day.
Giants: Pablo Sandoval was at third base for another game as regular starter Evan Longoria deals with soreness in his right glute. Longoria entered the game as a defensive replacement in the ninth. ... RHP Jeff Samardzija (inflamed throwing shoulder) will throw a simulated game Thursday at the team's Sacramento alternate site. ... LHP Drew Smyly, sidelined by a sprained index finger on his pitching hand, is still expected to be activated in the next couple of days.
Seattle's Nick Margevicius (1-2, 3.86) and San Francisco's Tyler Anderson (1-3, 5.18) pitch the series finale in a matchup of lefties Wednesday. Margevicius will make his fifth start after beginning the season in the bullpen. Anderson's last three starts all came against Arizona.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
DJ LeMahieu thrilled to play in front of crowd, knows 'how much it means to a lot of fans to watch the Yankees'
On Sunday, DJ LeMahieu and the New York Yankees will have a chance to feel that "adrenaline and excitement" that last season lacked, when they play in front fans against the Toronto Blue Jays to Steinbrenner Field.
Albert Pujols reiterates he'll decide future after season with Los Angeles Angels
Following last week's misinterpreted Instagram post, Albert Pujols reiterated his stance that he hasn't decided whether to retire after this season
Revisiting Miguel Cabrera's 2020 homers
As Miguel Cabrera attempts to get to 500 career home runs, relive all the dingers he hit during the 2020 season.
Detroit Tigers slugger Miguel Cabrera hopes to reach 500 home runs, 3,000 hits in 2021 season
Tigers star Miguel Cabrera is 13 home runs shy of 500 for his career and 134 hits short of 3,000. He hopes to reach both milestones this season. "We can do both," he said.
Chicago Cubs' Joc Pederson, Javy Baez both have something to prove, but for different reasons
Chicago Cubs shortstop Javy Baez and left fielder Joc Pederson both have something to prove in 2021, but for different reasons.
Los Angeles Angels re-sign veteran right-hander Jesse Chavez to minor league deal
Veteran right-hander Jesse Chavez is re-signing with the Los Angeles Angels on a minor league deal.