Ryan McMahon and Trent Grisham each hit two-run singles in the seventh inning by capitalizing on defensive positioning by the Seattle Mariners as the New York Yankees earned a 4-1 victory on Tuesday night.

The Yankees had runners at second and third against reliever Michael Rucker (0-4) after Jazz Chisholm Jr. stole second during a strikeout by George Lombard Jr.

After Spencer Jones walked to load the bases, McMahon got ahead in the count and poked a 2-1 curveball well out of the reach of rookie shortstop Colt Emerson to easily give the Yankees a one-run lead.

Seattle replaced Rucker with Eduard Bazardo and appeared to be out of the inning. Instead, Austin Wells hit a bloop single that fell in front of right fielder Taylor Ward and moved the runners up a base. On the next pitch Grisham slapped a sweeper to left field through the shortstop hole as Emerson was positioned closer to second base.

The base hits by McMahon and Grisham gave the Yankees their 30th comeback win and highlighted an inning when they sent nine to the plate. New York also improved to 17-10 in its past 27 games and moved three games ahead of the Boston Red Sox for the AL’s top wild-card spot.

Before the Yankees went ahead, Randy Arozarena homered in the sixth off New York’s Ryan Weathers, who was in line for a tough loss prior to the comeback.

Weathers allowed one run on two hits in 5 2/3 innings. The left-hander struck out four and walked three in a 106-pitch outing.

Tim Hill (4-2) followed Weathers by getting the next four outs ahead of the rally. Brent Headrick worked a 1-2-3 eighth and David Bednar struck out Cal Raleigh with a runner on second to secure his 27th save.

Seattle’s Bryan Woo survived a 33-pitch opening inning and held the Yankees to three hits in five innings. Woo struck out five, walked one and threw first-pitch strikes to 15 of 19 hitters.

The Mariners dropped their fifth straight and fell for the 14th time in 19 games. Seattle was held to three runs or fewer for the 13th time in its slump and was held to three hits or fewer for the 12th time.