SEATTLE -- Clint Frazier hit a go-ahead two-run double in the sixth and four relievers combined for shutout relief to lift the Yankees to a 6-4 win over the Mariners at Safeco Field on Sunday.

New York recorded its first series win since a three-game sweep of the Orioles from June 9-11. With Sunday's win, New York remains 2 1/2 games back of the Red Sox in the tightly contested American League East and a game up on the Royals and the Rays for the first AL Wild Card spot.

"Especially going into an off-day, we can build on this," Yankees manager Joe Girardi said. "Obviously we've been struggling for awhile and started out [after the All-Star break] on a road trip, and being able to have a positive road trip is a good sign, to me."

Frazier's double to left field off Mariners reliever Tony Zych capped off a three-run inning for the Yankees, who reclaimed the lead after the Mariners poured on four runs in the fourth inning. In the sixth, Chase Headley and Todd Frazier worked back-to-back walks and Ronald Torreyes singled to load the bases for Brett Gardner, who lined a single into left field for an RBI, tying the game at 4.

New York's offense was supported early on by the long ball, as Gardner launched a leadoff home run in the first off Seattle starter Yovani Gallardo, and Didi Gregorius hit homers in the second and fourth, the first multi-home run game of his career.

Gallardo was able to limit the damage to just the three solo home runs and left with the lead.

"It was the second pitch of the game. It was actually a pretty good pitch, he just went out and got it and pulled it," Gallardo said of Gardner's homer. "It was just one of those things where you try to make a pitch to get back in the count and he hits it out of the ballpark. The other two pitches [to Gregorius] were mistakes."

Yankees starter Caleb Smith took a no-decision in his first Major League start, and Chad Green (1-0) picked up his first Major League win after striking out three batters in 2 1/3 scoreless innings. Aroldis Chapman earned his 11th save despite finding his way into trouble in the ninth inning by allowing two hits.

Mariners reliever James Pazos took the loss, as he was charged with all three runs in the sixth. Gallardo finished with a no-decision in his first start since returning to the Mariners' rotation, allowing five hits in five innings.

"Down 3-0, I thought our guys did a great job to battle back," Mariners manager Scott Servais said. "Got some big hits, just not enough. It kind of came down to a battle of bullpens today, and theirs was a little bit sharper than we were in the sixth inning."