NEW YORK — Neil Walker hit a three-run homer, Zach Britton started a game-ending double play on New York’s third try in the ninth inning and the Yankees kept Boston from a bubbly celebration in the Bronx for at least another night with a 3-2 victory Tuesday.

Walker golfed a no-doubter in the seventh inning off Ryan Brasier for the Yankees’ third hit of the game and a 3-1 lead. Walker dropped his bat, admired the shot and then pointed into the Yankees dugout as he jogged to first base.

Mookie Betts got a day off for Boston after injuring his left side Sunday. Aaron Judge returned to New York’s lineup for the first time since breaking his right wrist July 26 but was 0 for 4.

Boston is trying to clinch the AL East at Yankee Stadium for the second time in three years. The Red Sox lead the Yankees by 101/2 games and entered the night with a magic number of four over the Astros to lock up baseball’s best record.

Britton had two on in the ninth after Brock Holt walked and Christian Vazquez reached when second baseman Gleyber Torres was unable to handle a wide feed from third on the first potential game-ending double play.

Britton then scooped a short grounder by Sam Travis and threw it into center field with runners at first and third, allowing Holt to score. Ian Kinsler followed with an almost identical ball back to Britton, and the left-hander hit the target this time for the final two outs.

Boston reliever Brandon Workman (6-1) walked two in the seventh before Walker took Brasier deep.

The Red Sox bullpen wasted six scoreless innings of two-hit ball from hard-throwing starter Nathan Eovaldi.