SEATTLE — Tyler Gilbert allowed two hits in another sharp outing, and Ketel Marte homered as the Arizona Diamondbacks beat the Seattle Mariners 5-4 on Sunday.

Arizona did more damage to the Mariners’ American League wild-card hopes with its second consecutive win, taking the series from a team that was surging just two days ago. Seattle now is three games behind Boston for the second wild-card spot with the Red Sox coming to town Monday for a three-game series.

It was the first road series win for the Diamondbacks since April 23-25, when they took two of three from Atlanta.

Asked if he remembered the previous road series win, David Peralta paused and said: “Today. That's in the past. I don't care about the past. Today is a good day.”

The Diamondbacks broke open a 1-1 game with four consecutive hits against reliever Anthony Misiewicz (4-5) to start the sixth inning. Henry Ramos’ two-run double made it 3-1 and rookie Seth Beer finished off the string of hits with an RBI single.

Gilbert (2-2) allowed two hits – solo home runs by Mitch Haniger in the fourth and Dylan Moore in the sixth – in 5⅓ innings. The rookie left-hander, who started his career with a no-hitter last month, struck out two in his sixth start.

“I felt I threw well minus one pitch,” Gilbert said. “I would say Haniger, I thought that was a good pitch to him, and he put it out over center field. I mean it was a good swing. But the one pitch I wish I could take back was the one to Moore. That change-up kind of hung.”

Four relievers combined for 2⅔ innings of hitless relief before J.B. Wendelken allowed an infield single to Luis Torrens and a two-run homer to Jarred Kelenic on a nine-pitch at-bat. But he finished the ninth with a strikeout and a putout at first to earn his first save.

Seattle had just 10 hits in its two losses to Arizona.

“You're hoping to do a little bit more against the Diamondbacks offensively,” Mariners manager Scott Servais said. “... Some days it's there, some days it's not. We're looking forward to the next series. We can't do anything about what just happened.”

ROSTER MOVE — The Mariners have reinstated left-hander Tyler Anderson from the bereavement list. He’s scheduled to make his regular start Tuesday when Seattle hosts Boston. The team optioned infielder Kevin Padlo to Triple-A Tacoma to make room on the roster.

UP NEXT — Mariners right-hander Logan Gilbert (5-5, 5.10) takes the mound against Boston on Monday with a chance to make up ground in the wild-card race. He’s lost his past three decisions.