Judge's seventh-inning two-run blast moved him to 61 single-season homers, equaling Roger Maris' long-held AL and franchise record set in 1961.
The homer ended Judge's run of seven homerless games, along with 31 consecutive plate appearances without a blast.
Judge delivered the shot in his fourth plate appearance of the game, going over left-field deep in the seventh from Tim Mayza, batting leadoff as the designated hitter.
"When I hit it, I thought I got enough but it's been a couple of games since I did that," Judge said.
"So, you never really know if it was going to get out out or, so, I tried to sprint around the bases a little bit then once it got over the fence, just relief that now we're leading the game.
"Getting a chance to tie Roger Maris, you dream about that kind of stuff, it's unreal."
Judge's blast came with scores tied at 3-3, opening up a two-run lead for the AL East-winning Yankees.
Harrison Bader had a single later in the seventh, before driving in two at the top of the ninth, reaching on a fielder's choice.
Yankees pitcher Gerrit Cole allowed three hits and three hits in six-and-one-third innings, striking out four to match Ron Guidry's franchise single-season record of 248 K's from 1978.
Escobar stars in Mets' walk-off win
The victory was critical for the Mets, giving them a one-game lead ahead of the Atlanta Bin the National League East, moving their magic number to clinch the division to six.
Trailing 4-0 at the bottom of the seventh inning, Escobar cut the lead in half with a two-run blast, before delivering an eighth-inning two-run single.
Escobar produced the walk-off single in the 10th inning, punching one through the hole of the left-side of the infield to drive in Francisco Lindor from second base.
Braves lose ground after Nats upset
The Braves let slip a huge opportunity to keep the pressure on the Mets, slumping to a 3-2 walk-off loss to the lowly Washington Nationals.
C.J. Abrams chopped a career-first walk-off single to right-field to drive in Alex Call for the game-winning run in the 10th inning. It was Abrams' third hit of the game.
Matt Olson crushed his 30th homer of the season among his two hits, while Michael Harris II hauled in a brilliant leaping catch at the center-field wall before driving in the game-tying eighth inning run for Dansby Swanson.
The Braves and Mets are set to meet in a crucial three-game series starting on Friday in Atlanta, weather permitting.