New York’s Aaron Judge, left, celebrates his home run against the Boston Red Sox with Giancarlo Stanton during the sixth inning Tuesday night in Boston. Steven Senne/Associated Press

BOSTON — Aaron Judge hit his major league-leading 56th and 57th home runs, Gleyber Torres had a go-ahead three-run double in the 10th inning and the New York Yankees held on to beat the Boston Red Sox 7-6 on Tuesday night.

Judge, playing in New York’s 142nd game, is four from tying the American League home run record Roger Maris set with the Yankees in 1961.

After going homerless in five games, Judge had a pair of of tying solo homers, off Nick Pivetta in the sixth and Garrett Whitlock in the eighth.

Judge has 10th multihomer games this season, one shy of the AL record Hank Greenberg set in 1938, and 26 in his career. Judge’s three hits raised his average to .310, and he leads the major leagues in home runs and with 123 RBI. Judge is hitting .310 with a 1.105 OPS. He has 32 RBI in his last 38 games.

New York, which came from behind three times, reopened a six-game AL East lead, its largest since Sept. 1.

Torres broke a 4-4 tie in the 10th against Jeurys Familia (2-3). He has eight RBI in his last three games after getting just three in his previous 14.

Advertisement

Clay Holmes (6-3) hit Reese McGuire with a pitch and got one out in the 10th. Alex Verdugo had an RBI single off reliever Wandy Peralta that put runners at the corners.

Xander Bogaerts popped out to shallow and Peralta bounced a fastball for a run-scoring wild pitch. Peralta struck out Rafael Devers on the seventh pitch of the at-bat, his first slider of the night, for his fourth save.

Rookie Triston Casas, McGuire and Bogaerts homered for Boston, which has lost 8 of 14 to the Yankees this season.

Marwin Gonzalez hit the first of three tying homers for New York, a two-run drive in the third.

Pivetta allowed three runs and six hits in 5 1/3 innings, walked two and struck out five.

New York’s Gerrit Cole struck out 10 over six innings, but was tagged for all three of Boston’s home runs over six innings.

Casas hit his first home run at Fenway Park, and McGuire hit his first home run this season.

NOTES: RHP Nathan Eovaldi (right shoulder inflammation) threw batting practice. He has been on the injured list since Aug. 19.