It is the third time Boston owns a 5 1/2-game lead on New York.
Those homers were enough for Fister (4-8), who held the Yankees to one run and four hits by working quickly and constantly getting groundouts. Fister threw first-pitch strikes to 18 of 26 hitters and recorded 11 of 21 outs via ground balls.
Fister allowed three hits within the first eight batters of the game and then starting rolling. He held the Yankees hitless in a span of 17 hitters from the second to the seventh until Chase Headley pushed a bunt single to the third base side of the mound.
The right-hander improved to 4-2 in his last six starts, a run that began with 7 2/3 innings on July 31 in place of injured David Price.
Addison Reed pitched a perfect eighth and Craig Kimbrel posted his 32nd save in 36 opportunities.
Gray allowed four runs and five hits in seven innings and saw his streak of 11 straight starts allowing two earned runs or less end by not locating fastballs. He tied a career worst by allowing three home runs for the fourth time, getting beat each time with fastballs.
Aaron Judge's double accounted for the lone Yankees run.
The Yankees took a 1-0 lead two batters into the game when Judge doubled to left field, but the Red Sox used their power to take the lead.
Nunez lined a 2-2 fastball into the left field seats with one out in the third for a 2-1 lead. Benintendi drove a first-pitch fastball into the right field seats with two outs in the fifth.
Boston went ahead 4-1 when Ramirez sent an 0-1 fastball into the Yankees bullpen beyond the center field fence to start the seventh.
NOTES: Both teams began their first round of September callups after rosters were expanded. The Red Sox recalled C Blake Swihart, 1B Sam Travis, RHPs Austin Maddox and Roenis Elias. The Yankees recalled RHPs Ben Heller and Bryan Mitchell along with LHP Jordan Montgomery. ... Yankees manager Joe Girardi said he might go with a six-man rotation after Thursday's day off. ... Boston LHP David Price (left elbow inflammation) threw a 29-pitch bullpen session without any difficulties. Manager John Farrell described it as "impressive and powerful" and said Price will throw again Sunday or Monday. ... Yankees DH Matt Holliday was activated off the disabled list after missing 25 games with a back injury.