NEW YORK (AP) — Wilmer Difo’s tiebreaking single in the ninth inning capped Pittsburgh’s biggest comeback of the season, and the Pirates rallied from an early five-run deficit to beat the New York Mets 6-5 Sunday.

The NL East-leading Mets jumped out to a 5-0 lead against Chase De Jong in the first on a two-run homer by Francisco Lindor and a three-run shot by Michael Conforto.

READ MORE: Wilkinsburg Arts Festravaganza Celebrates Arts

The Pirates began inching back via the long ball in the fifth, when Rodolfo Castro and Michael Perez hit back-to-back solo home runs.

Castro hit a two-run homer in the sixth — all three of his big-league hits are homers — before closer, Edwin Diaz wriggled out of a bases-loaded, one-out jam in the eighth to preserve a 5-4 lead.

Diaz (3-3) gave up a one-out double to Kevin Newman in the ninth before retiring Bryan Reynolds on a groundout. But John Nogowski hit an RBI single — his 14th hit in 28 at-bats since joining the Pirates on Monday — and Difo followed with his run-scoring hit down the third baseline.

The Mets headed into the All-Star break after blowing their biggest lead of a season in a loss.

David Bednar (2-1) allowed two hits in a scoreless eighth. Richard Rodriguez worked around a leadoff single by Brandon Nimmo in the ninth to earn his 12th save.

Adam Frazier had three hits for the Pirates, who are in last place in the NL Central at the All-Star Break for the first time since 2010. Difo and Newman had two hits apiece.

De Jong allowed the five runs on four hits and three walks with three strikeouts in five innings. He retired 14 of the final 16 batters he faced.

Lindor, who flew out to end the game, had three hits with a walk. He is batting .333 with two homers, 10 RBIs, and a .500 on-base percentage since July 1. He entered the month hitting .215 with nine homers, 26 RBIs, and a .301 on-base percentage.

Aaron Loup served as New York’s opener and tossed two scoreless innings in the first start of his 10-year big league career.

READ MORE: Man Dies After Being Struck By Vehicle Near Heinz Field On North Shore

SUNDAY SHUFFLING

Both teams returned their 27th man from Saturday’s doubleheader — RHP Geoff Hartlieb for the Mets and RHP Max Kranick for the Pirates — to their Triple-A affiliates. In addition, New York optioned RHP Nick Tropeano to Syracuse to make room for RHP Jerad Eickhoff and created a spot on the 40-man roster for Eickhoff by designating for assignment RHP Stephen Tarpley.

LOUP THERE HE IS

The start for Loup was his first since he was in Single-A with the Toronto Blue Jays organization in 2010. His 436 appearances without a start entering Sunday were the 19th-most among active pitchers.

TRAINER’S ROOM

Pirates: LHP Steven Brault (left lat) tossed 1 2/3 scoreless innings for Single-A Bradenton in his first rehab appearance. Brault has yet to pitch for the Pirates this season.

Mets: LHP David Peterson (right side) threw for the first time since he was injured June 30.

UP NEXT

After the All-Star Break, the Mets and Pirates oppose each other again, this time in Pittsburgh, for a three-game series scheduled to begin Friday.

MORE NEWS: Two People Found Dead In Forward Twp. Home, Police Investigating

(Copyright 2021 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)