NEW YORK (PIX11) — Starling Marte’s walk-off single in the ninth inning gave the Mets a 3-2 win over the Yankees Wednesday night.

Pete Alonso homered in the second inning and Francisco Lindor had an RBI single in the third inning for the Mets, which led 2-0 for most of the game.

Mets starting pitcher Max Scherzer pitched seven shutout innings, but the Yankees tied it in the eighth inning after Scherzer left the game. Gleyber Torres hit a two-run homer off Mets pitcher David Peterson to tie the game 2-2.

Eduardo Escobar led off the bottom of the ninth inning with a double and then scored from third base on Marte’s game-winning RBI single to left field.

Mets relief pitcher Seth Lugo (2-2) received the win. Yankees relief pitcher Wandy Peralta (2-3) took the loss.

Yankees starting pitcher Domingo German gave up two runs in 4.2 innings pitched.

The Mets won both Subway Series games at Citi Field. The two teams will play again in late August at Yankee Stadium.