NEW YORK (AP) — Tomás Nido hit a tying double with two outs in the 10th inning and scored the winning run on a throwing error by reliever Tanner Scott, and the New York Mets rallied to beat the Miami Marlins 5-4.

Pete Alonso homered and Francisco Lindor lined a two-run shot for the NL East leaders, who overcame injuries to right fielder Starling Marte and catcher James McCann in the middle innings. Both exited the game and are headed for MRIs on Sunday.

Miami designated hitter Garrett Cooper and manager Don Mattingly were ejected for jawing in the seventh with plate umpire Mark Ripperger.

After a pregame ceremony to retire No. 17 in honor of Keith Hernandez, the Mets pulled out a back-and-forth game in front of a sellout crowd of 43,336.