By MIKE FITZPATRICK AP Baseball Writer

NEW YORK (AP) Tim Lincecum had a lead and the bullpen did, too. But in a rare slip on the road, the San Francisco Giants let one get away.

Michael Cuddyer singled home the winning run in the bottom of the ninth inning, and the New York Mets topped the Giants 5-4 Thursday night to avoid a three-game sweep.

“Hard-fought series. Good road trip,” manager Bruce Bochy said. “You’d like to get greedy and get this one, but we just couldn’t hold the lead.”

Curtis Granderson scored twice and drove in a run to help New York win on a 91-degree night when chants of “Let’s go Giants!” rang out at Citi Field. The Mets beat the defending World Series champions for only the second time in 11 meetings, rebounding from a pair of humbling losses to start the series.

San Francisco rookie Chris Heston pitched a no-hitter Tuesday, and Mets ace Matt Harvey was hit hard again the following night.

Looking to win his seventh straight decision against New York, Lincecum was lifted after 4 2-3 innings.

“A little heavier air than we’re used to,” Lincecum said. “They got the best of me with that high pitch count.”

Sergio Romo (0-3) hit Granderson in the back on an 0-2 pitch with one out in the ninth. Granderson advanced to second on Andrew Susac‘s passed ball and third on Juan Lagares‘ groundout before Lucas Duda was intentionally walked.

Cuddyer, who had a go-ahead double that chased Lincecum in the fifth, stroked a sharp single into center field for the first game-ending hit the Giants have allowed all season.

San Francisco fell to 18-13 away from home, still the best mark in the National League.

“It’s huge morale-wise for us,” Mets manager Terry Collins said. “Today was a big one.”

Jeurys Familia (2-0) pitched a scoreless inning for the win.

Mets starter Jonathon Niese retired 12 in a row before substitute third baseman Eric Campbell committed a two-out error in the sixth. Brandon Crawford followed with his ninth homer, a long drive into the Giants’ bullpen in right-center that gave San Francisco a 4-3 lead.

Hunter Strickland gave up three straight Mets hits to the start the seventh, including a leadoff double by pinch-hitterDarrell Ceciliani and Granderson’s tying single.

Javier Lopez helped prevent further damage by getting Duda to ground into a 3-6-1 double play.

Lincecum held the Mets hitless until Travis d’Arnaud blooped an RBI double with two outs in the fourth. Niese opened the fifth with a double to deep center and scored on Duda’s sacrifice fly. Cuddyer put the Mets up 3-2 with a two-out RBI double.

“I just wasn’t executing,” Lincecum said. “When I got 2-0 on a lot of guys I wasn’t challenging the zone and then when I did they were being patient. Those were the guys that were working walks in deep counts and those kind of ate me alive today.”

The first four batters reached safely against Niese, and San Francisco scored on Buster Posey‘s run-scoring single and Justin Maxwell‘s double-play grounder.

“You want to take advantage of that situation,” Bochy said. “The guy made a pitch and got the double play.”

Niese settled in and went seven innings. He got 15 outs on the ground.

TRAINER’S ROOM

Giants: All-Star outfielder Hunter Pence (left wrist tendinitis) missed his seventh straight game and did not take any swings. Bochy said the team will make a decision about putting Pence on the disabled list when it returns home Friday to play Arizona. “Still in a holding pattern with him,” Bochy said. A potential replacement from the minors will be ready to meet the club in San Francisco, he said. … RHP Jake Peavy (back strain) threw 83 pitches in a rehab start for Triple-A Sacramento and struck out eight. He allowed four runs and seven hits in 4 1-3 innings against El Paso. Peavy will probably make at least one more rehab start before the Giants decide whether to activate him from the disabled list, Bochy said. … RHP Matt Cain (flexor tendon strain) was slated to throw a bullpen and then make his next rehab start Monday for Sacramento. He probably needs at least three more rehab starts to get ready, Bochy said.

ON A ROLL

Joe Panik extended his career-best hitting streak to 15 games. He is batting .397 with three homers and 10 RBIs during that span. Panik has reached base safely in 23 consecutive games, the longest active streak in the majors.

DENIED

San Francisco was trying for its first sweep of the Mets in New York since May 2002 at Shea Stadium.

UP NEXT

Giants: LHP Madison Bumgarner (7-2) faces Chase Anderson (1-1) and the Diamondbacks on Friday night. San Francisco has lost its last five home games.

Mets: Bartolo Colon (8-4) starts the opener of a three-game series against Alex Wood (4-3) and the Atlanta Braves.

Updated June 12, 2015

w11© 2015 by STATS LLC and Associated Press.
Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.