Boston Red Sox's Mookie Betts, left, gestures toward teammate J.D. Martinez after his single which drove in Betts and Blake Swihart, right, during the seventh inning of a baseball game against the Seattle Mariners at Fenway Park, Friday, June 22, 2018, in Boston. (AP Photo/Elise Amendola)
Boston Red Sox's Mookie Betts, left, gestures toward teammate J.D. Martinez after his single which drove in Betts and Blake Swihart, right, during the seventh inning of a baseball game against the Seattle Mariners at Fenway Park, Friday, June 22, 2018, in Boston. (AP Photo/Elise Amendola) Credit: Elise Amendola

BOSTON — J.D. Martinez homered and drove in five, and the Boston Red Sox rallied from a five-run deficit to beat the Seattle Mariners 14-10 on Friday night despite a monster game from Nelson Cruz.

Cruz had a pair of three-run homers and drove in seven, but the Mariners still lost their season-worst fifth straight game, including three earlier this week at Yankee Stadium. Seattle led 4-0 and 10-5 before a wild Red Sox rally fueled by RBIs from eight different players.

Martinez went 4-for-5, including a two-run homer in the sixth and two doubles. The Red Sox set a season high with 20 hits.

Reliever Matt Barnes (1-2) got the win with one scoreless inning, and Craig Kimbrel pitched the ninth.

Juan Nicasio (1-4) took the loss, allowing five runs on four hits in one-third of a lousy seventh inning.

The only flaw to the second half of the game for Boston: shortstop Xander Bogaerts left in the seventh with a sprained index finger on his left hand.

Ryon Healy hit a solo homer during Seattle’s four-run first inning as the Mariners got to knuckleballer Steven Wright. Seattle added two more off Wright in the second after Boston’s five-run bottom of the first.

Seattle scored four in the fourth, including Cruz’s second three-run shot of the game, but Boston’s bullpen shut down Seattle the rest of the way while the Mariners’ imploded.

Rafael Devers singled in a run in the fifth, and then Martinez homered off Nick Vincent to center in the sixth to pull Boston within 10-8. Mitch Moreland followed with a triple just beyond the reach of diving right fielder Mitch Haniger, and Bogaerts drove in Moreland with an infield single

Barnes struck out the side in the seventh, and then Boston got to Nicasio. Devers singled to lead off, Blake Swihart singled with one out and Nicasio walked Mookie Betts to load the bases. Andrew Benintendi blooped a single into shallow center to bring in Devers and tie it at 10.

Swihart was nearly picked off third as Benintendi scored, but he slid under the tag after a strong throw by center fielder Guillermo Heredia. Seattle did not challenge the close play, and Martinez followed with a two-run single.

Nick Rumbelow later allowed Benintendi to score on a wild pitch, and Eduardo Nunez added a pinch-hit RBI single.

TRAINER’S ROOM — Mariners: Activated RHP Vincent (strained right groin) from the 10-day DL and optioned RHP Ryan Cook to Triple-A Tacoma.

Red Sox: Benintendi needed a minute to collect himself after running hard into the Green Monster on a double by Denard Span.

UP NEXT — Mariners: RHP Mike Leake (7-4, 4.47 ERA) gets his second straight start against the Red Sox after taking the loss Sunday in Seattle, allowing five runs on eighth hits in six innings.

Red Sox: LHP Eduardo Rodriguez (9-1, 3.59) has won a career-high six straight starts, including Boston’s 9-3 victory over the Mariners in Seattle on Sunday.

PAWSOX STAYING? — Rhode Island lawmakers moved Friday to help secure the Pawtucket Red Sox’ future in the state, offering to forfeit up to $38 million in city and state taxes on a new stadium and its surrounding area.

The General Assembly passed legislation to enable the team, state and city to begin shopping for bonds to finance a new stadium at Slater Mill in Pawtucket. Lawmakers spent months negotiating the deal, but the final bill was passed just over 24 hours after it was first introduced in a committee.

The bill’s architects said the legislation doesn’t finalize a deal. They still have to make sure they can secure the bonds at economically feasible rates.

Lawmakers said the bond market would ultimately determine whether a deal is made.

Under the legislation, the PawSox would contribute $45 million to the $83 million project. It would also be responsible for any cost overruns.

The state and city would be responsible for the remaining $38 million in bonds issued by the Pawtucket Redevelopment Agency.

The plan, pushed by Democratic House Speaker Nicholas Mattiello, would finance that money with so-called “special revenue bonds.” Only tax revenue generated directly by the stadium and its surrounding area would go toward paying off the bonds.

If revenues fall short, the state wouldn’t need to settle the debt. It’s less risky but more expensive to finance bonds when they aren’t guaranteed by the state.

House officials said they can’t estimate the added costs until they begin shopping for the bonds.

Senate officials estimated the total cost of the stadium, including the team’s contributions, would likely be more than $50 million costlier than the plan they passed earlier in the session.

That plan would have guaranteed $23 million from the state and $15 million from the city for the project. Under the new deal, taxpayers are no longer on the hook for that money.

The PawSox are the Triple-A affiliate of the Boston Red Sox. Team officials said it would be premature at this point to comment on the legislation.

Pawtucket Mayor Donald Grebien and the city’s congressional delegation have said a new stadium is critical to the city’s economic interests.

Worcester, Massachusetts, has also been wooing the team. That city could still potentially lure the team north.

Republicans, who are dramatically outnumbered in the state’s legislature, described the legislation as a significant risk to the state, pointing to declining interest in baseball and Pawtucket’s fiscal troubles.