San Francisco Giants pitcher Ross Stripling throws against the New York Mets during the first inning of a game in San Francisco on Sunday.
                                 AP photo

San Francisco Giants pitcher Ross Stripling throws against the New York Mets during the first inning of a game in San Francisco on Sunday.

AP photo

Tired of ads? Subscribers enjoy a distraction-free reading experience.
Click here to subscribe today or Login.
<p>The San Francisco Giants’ Joc Pederson hits an RBI-single against the New York Mets during the first inning of a game in San Francisco on Sunday.</p>
                                 <p>AP photo</p>

The San Francisco Giants’ Joc Pederson hits an RBI-single against the New York Mets during the first inning of a game in San Francisco on Sunday.

AP photo

<p>New York Mets pitcher Tylor Megill throws against the San Francisco Giants during the first inning of a game in San Francisco on Sunday.</p>
                                 <p>AP photo</p>

New York Mets pitcher Tylor Megill throws against the San Francisco Giants during the first inning of a game in San Francisco on Sunday.

AP photo

SAN FRANCISCO— In his first game back from the injured list, Joc Pederson provided an instant boost for the San Francisco Giants.

The two-time All-Star hit an RBI single in the first inning and scored the tiebreaking run from first base on Mike Yastrzemski’s one-out double in the eighth, sending San Francisco to a 5-4 win over the New York Mets on Sunday.

“Against a good team like the Mets, you win a couple of games in a row to finish the series, it certainly gives you a chance to ride that momentum into the next series,” Giants manager Gabe Kapler said.

Pederson missed nine games with inflammation in his right wrist, and San Francisco went 2-7 in his absence.

He started the winning rally with a one-out walk against Drew Smith (1-1). Yastrzemski followed with a line drive into right-center, and a sliding Pederson beat the relay to the plate, rolling over as he scored.

“Yaz came up with a huge hit and put it in the gap,” Pederson said. “I knew that their pitching’s been good the whole series, so (you) have to take advantage of an opportunity that we got. It was a good send by (third base coach Mark Hallberg).”

Thairo Estrada hit his fourth home run for the Giants, who won consecutive games for the first time this season to split the four-game series. San Francisco entered with the third-lowest winning percentage in the National League.

Touted rookie Francisco Álvarez hit his second major league home run and first this year, which marked the first extra-base hit by a Mets catcher this season.

New York finished 7-3 on its West Coast trip.

Scott Alexander (2-0) worked a perfect eighth and Camilo Doval struck out his first two batters in a 1-2-3 ninth for his second save.

The Giants led 4-3 following rookie Brett Wisely’s first career RBI in the fourth, a one-out grounder against New York starter Tylor Megill.

Megill, winless in his last two starts after beginning the season 3-0, allowed four runs and six hits in four innings.

Álvarez’s home run off Tyler Rogers with two outs in the sixth tied it at 4.

New York scored twice in the fourth on consecutive sacrifice flies. Giants right fielder Michael Conforto dropped the first one for an error, sending Daniel Vogelbach to third base. He came home on Brandon Nimmo’s sac fly.

Ross Stripling was uneven in his return to San Francisco’s rotation after making three appearances out of the bullpen. The right-hander, signed as a free agent in the offseason, lasted 3 1/3 innings and allowed three runs and six hits.

“Overall I thought it was a step in the right direction,” Stripling said. “That’s a challenging lineup. Obviously we’ve seen what they’ve done this series, so it’s a good test. I really thought I commanded most of my pitches and was ahead more than I’ve been in prior outings.”

Francisco Lindor had an RBI double for the Mets in the third.

TRAINER’S ROOM

Mets: RHP Justin Verlander (low grade teres major strain in his upper back) threw 43 pitches over three innings of live batting practice with good results, manager Buck Showalter said. Verlander is scheduled to make a minor league rehab start Friday. … C Omar Narváez (left calf strain) is making slow progress and has been squatting and catching balls off a machine in recent days.

Giants: OF Heliot Ramos was optioned to Triple-A Sacramento to open a roster spot for Pederson.

UP NEXT

Mets: Following an off day Monday, New York opens a seven-game homestand against the Nationals and Braves. Showalter had not announced a starter for Tuesday night.

Giants: RHP Alex Cobb (0-1, 2.79 ERA) starts the opener of a four-game home series with St. Louis on Monday. Cobb has made it past the fifth inning just once in four starts this season.