NEW YORK (AP) — Omar Narváez capped a three-run, ninth-inning rally with his first hit of the year at Citi Field after an 0-for-27 start, lifting the New York Mets over the San Francisco Giants 4-3 on Sunday to stop a five-game losing streak.

New York had blown leads from the sixth inning on in its previous three games and had scored three runs in 18 innings before overcoming a 3-1 deficit in the ninth against Tyler Rogers (0-1).

Brandon Nimmo and J.D. Martinez opened with singles and scored on Harrison Bader’s one-out double. Brett Baty was intentionally walked and Narváez, who entered after catcher Tomás Nido was pinch hit for in the eighth, singled on an 0-1 pitch.

Bader had an RBI single in the second and robbed Matt Chapman of a home run with a leaping catch at the center-field wall in the sixth.

New York (22-30) has five walk-off wins among 11 home victories. San Francisco, which had won four straight, dropped back to .500 at 27-27.

Adrian Houser (1-4) gave up one run over four innings in relief of Sean Manaea, who allowed two runs over five innings.

Brett Wisely had his third straight multi-hit game and homered in the third for the Giants. Chapman scored on a throwing error by Nido in the second, and Heliot Ramos hit into a run-scoring forceout in the sixth.

Logan Webb allowed an unearned run and struck out eight in seven innings.

New York acquired minor league infielder Pablo Reyes from Boston for cash.

TRAINER’S ROOM

Giants: 1B LaMonte Wade Jr. (left hamstring) did not play. Manager Bob Melvin said he wanted to give Wade, who tweaked his hamstring making stretches in the ninth inning of Friday’s 8-7 win, one more day of rest.

Mets: Manager Carlos Mendoza said LHP David Peterson, who hasn’t pitched this season following left hip surgery last November, will be activated to start Wednesday against the Los Angeles Dodgers. Peterson will take the rotation spot of Houser.

UP NEXT

Giants: Though his girlfriend has not yet given birth to their child, LHP Blake Snell (0-3, 11.40) was activated after spending the maximum three days on the paternity list. He remained in San Francisco and is scheduled to still the scheduled starter for Monday’s series opener against Philadelphia and RHP Taijuan Walker (3-0, 5.06 ERA). RHP Nick Avila was optioned to Triple-A Sacramento.

Mets: RHP Tylor Megill (0-2, 3.00 ERA) is slated to start Monday against Dodgers RHP Gavin Stone (4-2, 3.60 ERA). Rain is forecast.

___

AP MLB: https://apnews.com/hub/mlb