BOSTON (AP) — With two more wins before they leave Boston, the New York Yankees would be able to end the three-year run by the Red Sox atop the AL East.

That, left-hander J.A. Happ said, would be a nice way to finish up with their longtime rivals for the season.

“They won the World Series last year and knocked us out,” Happ said with a smile on Saturday after pitching the Yankees to a 5-1 victory over the Red Sox. “So, I’m sure it wouldn’t feel bad.”

Happ (12-8) pitched shutout ball into the seventh inning, combining with four relievers on a five-hitter for the Yankees, who lead third-place Boston by 16½ games in the division. He allowed two hits in 6 1/3 innings, striking out seven and walking one.

Happ has not allowed a run in his last 15 1/3 innings.

“He was in command of that game from the start,” Yankees manager Aaron Boone said. “To get into the seventh inning against that team … really excited to see.”

Edwin Encarnacion homered and added a double, driving in three runs for New York, which has won three of its last four games and nine of 12.

J.D. Martinez homered off Yankees closer Aroldis Chapman with two outs in the ninth. The Red Sox began the day six games behind Oakland for the second AL wild-card spot. The Red Sox matched a season high using eight pitchers, a day after employing seven in Friday night’s win.

“Got to give some credit to Happ,” said Xander Bogaerts, who had one of the hits off him. “He dominated us today and for some reason we couldn’t stop chasing those high fastballs and chasing the strike zone.”

After losing 6-1 at Fenway Park on Friday night, the Yankees were aided by a bright late-afternoon sun that played tricks with Red Sox fielders on back-to-back doubles in a four-run fourth.

DJ LeMahieu opened the inning with a single off Ryan Weber (2-3), Boston’s third pitcher of the game. Aaron Judge struck out, but Martinez then lost Didi Gregorius’ flyball to right field in the sun, the ball flicking off his glove and rolling to the wall.

Gary Sanchez greeted reliever Colten Brewer by lofting a flyball down the right field line. As three Boston fielders — first baseman Mitch Moreland, second baseman Brock Holt and Martinez — converged on the ball, it dropped just inside the line and bounced into the stands for a ground-rule double, scoring LeMahieu and Gregorius.

Martinez, normally Boston’s designated hitter, played the outfield while Jackie Bradley Jr., a left-handed hitter, got a day off against the left-handed Happ.

“I never played there, but I have shagged around that time. It’s pretty tough,” Red Sox manager Alex Cora said of the right field sun. “The ball never came out. It was hit hard so he didn’t have time to adjust. He put his hand up and all that. I think the ball hit his glove, I think.”

“As an outfielder you got to take charge on that one,” Cora said of the Sanchez play.

Encarnacion hit the next pitch for his 32nd home run of the season, making it 4-0. It’s his 11th with the Yankees since coming over from Seattle in June. The Yankees added a run in the ninth when Sanchez was hit by a pitch with two outs and Encarnacion followed with an RBI double to deep center field.

“When he gets hot, I haven’t seen many better hitters in the game,” Happ said, noting that Encarnacion missed most of August with a wrist injury. “For just coming back, it’s been awesome.”

LOOKING AHEAD:

Boone said he plans to use the remainder of the season to gauge the health of several players returning from injuries and how they can help in the postseason.

“These three weeks will be important in seeing where guys are as we get into the decision-making process, how we’re going to match guys up,” the manager said.

TRAINER’S ROOM:

RHP Luis Severino (right shoulder rotator cuff inflammation, lat injury) threw 50 pitches plus five more in the bullpen Friday in a second rehab outing with Double-A Trenton. Boone said the team will map out a plan for what’s next for him

3B Gio Urshela (left groin injury) will likely be active for Sunday’s game but Boone isn’t sure if he will start

RHP Dellin Betances (right shoulder impingement, lat injury) had his first rehab outing Friday for Trenton and is expected to pitch again on Monday

UP NEXT:

RHP Masahiro Tanaka (10-8, 4.42 ERA) is scheduled to start for the Yankees, opposed by RHP Rick Porcello (12-11, 5.63).

(© Copyright 2019 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)