SEATTLE — James Paxton couldn’t give the slumping Seattle Mariners the effective outing they needed.

Elvis Andrus offset a pair of errors with a homer and three doubles, Jonathan Lucroy hit a two-run homer and the Texas Rangers held off the Mariners 10-7 on Tuesday night.

Paxton (4-6) struck out eight in 4 1/3 innings, including four in the first, but was tagged for six runs — four earned — and nine hits before being lifted after 103 pitches.

“Not a good night when you throw like 100 and something pitches in 4 1/3 or whatever it was,” Mariners manager Scott Servais said.

Seattle, which was 10 games above .500 on Aug. 22, fell to 70-68 and 12 ½ games behind the Rangers. The Mariners have lost 10 of 13.

Martin Perez (10-10) allowed four runs — two earned — and seven hits in six innings to win for the third time in his last 13 starts. Sam Dyson pitched the ninth for his 32nd save.

The Rangers snapped a 4-4 tie with three runs in the fifth. Lucroy chased Paxton with his ninth homer since joining the Rangers — he had 13 with Milwaukee prior to the Aug. 1 trade. Drew Storen relieved and gave up doubles to Andrus and pinch-hitter Mitch Moreland.

“I threw some good pitches and got the strikeouts, obviously, and that was good,” said Paxton, adding that he was not bothered by a fingernail torn in his previous start. “I just fell behind some guys and came to the middle part of the zone, and they got some hits.”

Andrus opened the seventh with his fifth home run off Arquimedes Caminero to make it 8-4. Seattle cut it to 8-6 in the bottom on a bases-loaded walk to Kyle Seager and Leonys Martin’s sacrifice fly.

Andrus added an RBI double in the eighth. Seth Smith answered with a pinch-hit homer in the bottom half, his 12th, to make it 9-7. Lucroy drew a bases-loaded walk in the ninth for the final run.

“They’ve got a damaging offense, also. They can grind some at-bats out and that’s kind of what they’ve done all year long,” Rangers manager Jeff Banister said. “It felt like that was going to be the last-man-standing type of game, where whoever was going to be able to get the most outs without giving up damage was going to come away the winning ballclub.”

Seager pulled the Mariners even in the third with a two-run homer, his 26th, matching his career high set last season.

One of Paxton’s four first-inning strikeouts cost him a run. Ian Desmond struck out, but reached on a wild pitch. Carlos Beltran singled him to third and Adrian Beltre punched an opposite-field dribbler into right for an RBI single.

Texas, which leads the AL West by 8 ½ games, had a season-high seven doubles among its 15 hits and won for the eighth time in 10 games.

SEAGER HOT VS. TEXAS

Seager’s homer was the 18th of his career against Texas, the most against any single opponent. Since Aug. 6, Seager is hitting .354 (35 for 99) with six homers, 21 RBIs, four doubles and 20 runs.

TRAINING ROOM:

Mariners: RHP Tom Wilhelmsen, eligible to come off the 15-day DL (low back spasms), is on track to throw a simulated game on Thursday after an incident-free bullpen on Tuesday. … Veteran OF Norichika Aoki was recalled Tuesday after a short stint at Triple-A Tacoma.

UP NEXT:

Rangers: RHP A.J. Griffin (7-3, 4.41 ERA) has allowed three runs or fewer in six of his last eight starts. Griffin has won his last two starts, beginning with six scoreless innings in a victory over Cleveland.

Mariners: LHP Ariel Miranda (2-1, 5.76 ERA) makes his sixth start since being acquired from Baltimore on July 31 in the trade for Wade Miley. Miranda was tagged for four runs in the first in his last start against the Angels, but followed with five scoreless innings for the victory when the Mariners rallied.