SEATTLE — Pinch-hitter Kyle Schwarber hit a tiebreaking three-run double in the eighth inning and the Boston Red Sox beat the Seattle Mariners 8-4 on Tuesday to keep pace in the competitive American League wild-card race.

Schwarber, out of the lineup in favor of Alex Verdugo, entered against reliever Drew Steckenrider with one out in the eighth and the bases loaded. His double to right ended a tense standoff with the Mariners, who beat the Red Sox 5-4 on Monday with the help of Schwarber’s fielding error.

Verdugo added a two-run home run in Boston’s next at-bat against Yohan Ramirez.

The victory kept the Red Sox percentage points behind the New York Yankees and Toronto Blue Jays for the AL’s two wild-card spots. Seattle dropped to three games back.

Boston starter Nathan Eovaldi, who struck out nine in the game, said the series feels like the postseason has already started.

“I feel like it has,” he said. “It’s very fun, you know what I mean? I feel like everyone is drained after the game.

“Everybody’s focusing, everybody’s battling out there, grinding. It was a big team win for sure.”

Adam Ottavino (6-3) recorded the final out of the seventh inning for the win, which came after a stretch of six losses in eight games for the Red Sox. Eovaldi pitched five innings, leaving with the game tied at 2.

Xander Bogaerts tripled off the wall in right field to start the eighth inning, chasing reliever Joe Smith (2-4). Steckenrider entered tied with teammate Casey Sadler for the longest active scoreless streak in the AL at 18 innings, but he walked Rafael Devers to put runners at the corners. After a force out, he walked the bases loaded after starting with two strikes to pinch-hitter Travis Shaw.

Cora said he had no qualms about going to Schwarber, who has been struggling at the plate but hit before the game in both the indoor and outdoor batting cages.

“Those guys did an amazing job behind (Bogaerts),” Boston manager Alex Cora said. “Travis with the walk and then Kyle staying on a pitch and hitting a double. It was a great win. One that we needed obviously. We know where we are at and we know where they are at and everybody else. This was a good win.”

The outing was a rare failure by Seattle’s bullpen, one of the top performing units in the major leagues this year. Reliever Anthony Misiewicz also gave up a home run, allowing Seattle native Bobby Dalbec to tie it at 2 in the sixth after he inherited a one-run lead from starter Tyler Anderson.

Smith shouldered some of the blame for allowing Bogaerts’ long triple, putting Steckenrider in a tough spot.

“Those were some really good at-bats those guys threw up against one of our best,” Smith said.

It was Boston’s 42nd come-from-behind win this year.

Boston’s J.D. Martinez hit his 26th home run to open scoring in the fourth inning. The Mariners answered in the bottom of the inning with consecutive hits by Mitch Haniger and Kyle Seager. Hunter Renfroe then dropped Ty France’s high fly ball in right field to score Haniger and tie it at 1. Jake Fraley made it 2-1 later in the inning with a sacrifice fly.

HANIGER’S HUNDRED — Haniger scored his 100th run of the season in the fourth inning. He’s the first Mariners player to score that many since Robinson Cano had 107 in 2016.

TRAINER’S ROOM — Fraley (right shoulder inflammation) was activated from the injured list and started in left field. He has been out since Aug. 28. ... Right-hander Justin Dunn (right shoulder inflammation) feels well enough to go on a rehab stint after two simulated games, manager Scott Servais said. The team has not yet scheduled the appearance, however. The starter will go to the Mariners’ bullpen if he’s able to return before the end of the season.

UP NEXT — Red Sox right-hander Tanner Houck (0-4, 3.54) looks for his first win as he finishes off the series with Seattle. The Mariners’ Marco Gonzales (8-5, 4.03) has won his past seven decisions, a career-best stretch.

Boston Seattle

ab r h bi ab r h bi

Hernandz cf 4 0 0 0 Crawford ss 3 0 1 1

Renfroe rf 4 0 0 0 Haniger rf 5 1 2 1

Bogaerts ss 5 2 2 0 Seager 3b 3 1 1 0

Devers 3b 3 1 1 0 France 1b 4 0 1 1

Martinez dh 5 1 2 2 Toro 2b 4 0 0 0

Dalbec 1b 3 1 1 1 Kelenic cf 4 0 0 0

Shaw ph-1b 1 1 0 0 Fraley lf 3 1 0 1

Plawecki c 3 0 1 0 Bauers dh 2 0 0 0

Schwarbr ph 1 0 1 3 Torrens dh 2 1 1 0

Vazquez pr-c 1 1 0 0 Raleigh c 4 0 2 0

Verdugo lf 4 1 2 2

Iglesias 2b 3 0 1 0

Totals 37 8 11 8 Totals 34 4 8 4

Boston 000 101 051 — 8

Seattle 000 200 002 — 4

E—Renfroe (11), Shaw (2), Toro (7). DP—Boston 1, Seattle 1. LOB—Boston 8, Seattle 8. 2B—Schwarber (7), Raleigh (10). 3B—Bogaerts (1). HR—Martinez (26), Dalbec (22), Verdugo (13). SF—Fraley (2), Crawford (4).

IP H R ER BB SO

Boston

Eovaldi 5 5 2 1 1 9

Hernandez 12/3 0 0 0 1 2

Ottavino W,6-3 1/3 0 0 0 0 0

Feliz 1 0 0 0 1 0

Sawamura 1/3 2 2 0 0 1

Davis 2/3 1 0 0 0 1

Seattle

Anderson 41/3 4 1 1 2 5

Sadler 2/3 0 0 0 0 1

Misiewicz BS,0-5 1 2 1 1 0 1

Smith L,2-4 1 1 1 1 0 2

Steckenrider 1/3 1 3 3 2 0

Ramirez 2/3 1 1 1 0 1

Andriese 1 2 1 1 0 0

Smith pitched to 1 batter in the 8th.

HBP—Ramirez (Iglesias), Andriese (Devers). WP—Eovaldi, Ramirez.

Umpires—Home, Brennan Miller; First, Hunter Wendelstedt; Second, Tripp Gibson; Third, Quinn Wolcott.

T—3:59. A—19,887 (47,929).