New York clinches home field in wild-card game with series-opening victory.

BOSTON – If you’re a Red Sox fan and you’re worried that the Yankees dominated the Red Sox Friday night, a week before a possible showdown in the AL Division Series, calm down and remember that William Cuevas will not make the postseason roster.

On the other hand, J.A. Happ definitely will for the Yankees in the playoffs and for quite a while that appeared to be a cause for concern.

The Yankees scored six runs in the fourth inning against Cuevas to take an 8-0 lead and cruised to an 11-6 victory at Fenway Park.

The 99th victory of the season clinched home field for the Yankees in the wild-card playoff game Wednesday against Oakland. The Sox will host the winner of that contest in Game 1 of the ALDS on Friday.

The Yankees hit four home runs to give them 264 for the season to tie the 1997 Seattle Mariners for the major league record. So there’s that for Sox fans to worry about as well.

Haap blanked the Sox on one hit over five innings and probably had Sox fans wishing Boston had acquired him instead of Nathan Eovaldi, but Steve Pearce pounded a grand slam off him with two outs in the sixth to make it 8-4. Pearce followed a single by Mookie Betts, a double by Andrew Benintendi and a walk to Xander Bogaerts with the fourth grand slam of his career and the 10th by the Sox this season. Pearce added a run-scoring single in the eighth and made his case to get some playing time in the postseason.

Nevertheless, Haap improved his record to 7-0 since the 35-year-old southpaw was acquired from Toronto on July 26. In 11 starts with New York, the 6-foot-5 Haap owns a 2.68 ERA and has fanned 63 batters in 63-2/3 innings. Haap is only 1-1 against the Red Sox this season, but in his first 22-1/3 innings vs. Boston he allowed only one earned run. Pearce changed all that with the first pitch Haap threw him.

In his previous start at Fenway Park on July 12 for Toronto, Haap lasted only 3-2/3 innings and allowed five runs, but they were all unearned, in a 6-4 Red Sox victory. Overall, Haap is 17-6 with Toronto and New York this season.

Haap retired the first nine Sox batters before walking Betts to lead off the fourth and surrendering a single to right to Benintendi. They were stranded.

The Sox had dominated the Yankees at Fenway Park this season, winning six of their first seven meetings here, but New York figured out a way to end that trend on Friday: Hit the ball out of the ballpark. Gary Sanchez, Luke Voit and Aaron Judge smashed solo home runs and Aaron Hicks blasted a three-run home run. The Sox fell to 9-8 overall this season against the Yankees.

The Sox have clinched the best record in baseball so manager Alex Cora used a lot of pitchers on Friday that the Yankees or Athletics won’t see much of, if at all, in the postseason: Brian Johnson, Cuevas, Heath Hembree, Drew Pomeranz, Joe Kelly and Bobby Poyner.

The Yankees grabbed a 2-0 lead in the top of the third. Sanchez, hitting only .182 when he stepped to the plate to lead off, smashed Johnson’s 89-mph fastball on a 2-0 pitch over the Green Monster seats to give the Yankees a 1-0 lead. It was Sanchez’s 18th home run. With two outs in the inning, Johnson broke Giancarlo Stanton’s bat. Half of the bat sailed into the stands and the other half got enough of the pitch to line softly into center field for a run-scoring single.

Cuevas retired the first batter he faced in the fourth, but then allowed six hits and a walk without getting another out. Gleyber Torres began the scoring in the six-run fourth with a two-run double, Andrew McCutchen hit a run-scoring single and Hicks clubbed a three-run home run to right for his 27th home run of the season.

When Stanton followed Hicks’ blast with a single, Cora finally took Cuevas out and brought in Heath Hembree to get out of the inning.

Rookie Voit hit his 13th home run in the seventh against Pomeranz. Didi Gregorious scored later in the seventh when Bogaerts allowed Sanchez’s inning-ending double play ball to go through his legs.

Judge homered off Poyner’s first pitch in the eighth.

Bogaerts forced in a run with a bases-loaded walk in the ninth.

The Sox would like to forget about this game as soon as possible, especially catcher Blake Swihart. He dropped a throw that would have nailed a Yankee at the plate and struck out three times. Betts, on the other hand, had a single, two walks and a nice running catch in right.