Tied 3-3 in the fifth inning, Sanchez lifted a 2-2 pitch from Boston's Rick Porcello over the Yankees' bullpen in right field Saturday night. The All-Star catcher leads the American League with 18 home runs.
Sanchez's 18 home runs this season match his total from last season. Injuries limited Sanchez to just a .186 average in 89 games last year.
"He's raking right now and it's really impressive," Yankees first baseman Luke Voit said. "That's why I get hyped about it. He's being Gary Sánchez."
Boston scored first on catcher Sandy Leon's RBI single in the second inning. The Yankees rallied for three runs in the bottom half of the inning and took the lead on second baseman DJ LeMahieu's two-run single.
Boston tied the game with two runs against Domingo German in the fourth inning. German was pulled for Chad Green, who struck out two of the six hitters he faced.
New York's bullpen held on to give the Yankees a 2 1/2-game lead over Tampa Bay for first place in the AL East Division.
The Yankees are 4-0 against the Red Sox this season.
The Yankees have won nine straight series for the first time since 1998. New York finished that year with 114 regular season wins and swept the San Diego Padres in the World Series.
Boston enters Sunday's series finale with a 29-29 record. The Red Sox are 9 1/2 games back of the Yankees in the AL East.