NEW YORK - The Yankees tied a major league record with five home runs in an inning and hit six overall in a 10-7 win over the Toronto Blue Jays on Thursday night that extended their winning streak to eight.

New York set a major league record for most home runs in a three-game span with 19 and became the first team with six or more home runs in three straight games. The Yankees (29-21) outscored Toronto 43-15 over the three games and ouhit the Blue Jays 44-28, opening a 2 1/2-game over the Toronto for second place and closing within one game of Minnesota (31-21) for a first-round playoff series at home.

Brett Gardner, DJ LeMehieu and Luke Voit homered on consecutive pitches in the fourth inning from Chase Anderson (0-2). Voit's home run was his major league-leading 20th.

Aaron Hicks struck out, and Giancarlo Stanton and Gleyber Torres followed with home runs that gave the Yankees a 9-2 lead and chased Anderson. The Yankees hit five homers in an inning for the first time, the seventh big league team to achieve the feat.

The Yankees hit 2,005 feet of home runs in the inning, according to Statcast, 2,377 in the game and 7,496 in the series -- more than 1.4 miles.

Gary Sanchez, slumping for most of the season. added a seventh-inning homer off T. J. Zeuch for a 10-3 lead and had his first multihit game this year.

After losing 15 of 20 games and nearly dropping out of the AL's eight playoff spots, the Yankees have outscored their opponents 71-20 over their winning streak.

Masahiro Tanaka (3-2) allowed three runs and seven hits in seven innings, striking out five.

Toronto closed in the ninth against Jonathan Holder on Danny Jansen's run-scoring single and Cavan Biggio's bases-loaded walk. Aroldis Chapman relieved with the bases loaded and gave up a two-run single to Bo Bichette, then struck out Randal Grichuk and Teoscar Hernandez for his third save. Chapman threw fastballs on all 12 pitches, ending the game was a 101 mph pitch that Hernandez missed.

Anderson gave up seven runs and eight hits in 2 2/3 innings.

Lourdes Gurriel Jr. was 3 for 3 with two homers off Tanaka and added an infield single in the ninth. He is 11 for 20 with three homers and five RBIs against the Yankees this season.

Tanaka has thrown at least five innings in each of his last five starts.