NEW YORK -- Brett Tomko ended San Francisco's losing streak just about by himself.
"It's been a rough road trip," Tomko said. "Guys aren't giving up, they're trying as hard as they can."
Lance Niekro homered and got three hits, Deivi Cruz added three hits and Marquis Grissom drove in the go-ahead run with a sixth-inning double, ending San Francisco's longest slide since also dropping eight straight in May 2000.
But the star was Tomko, who gave the Giants a much-needed lift after their starters went 0-4 with a 6.99 ERA during the skid.
"I knew it was going to take that kind of pitching performance," manager Felipe Alou said. "That's how you win games, it's not how you stop streaks."
Jason Schmidt (3-1) started the second game for San Francisco against Kris Benson (3-2). The opener was a makeup of Friday night's rainout.
With the score tied at 1 in the sixth, Mets starter Kazuhisa Ishii issued his first walk of the game to Niekro. Two outs later, Cruz singled and Grissom followed with a drive to deep center that Carlos Beltran probably should have caught. But as Beltran retreated, the ball sliced back over his head and bounced over the fence for a ground-rule double.
"He must have misjudged it, I guess. The ball was hit pretty hard," New York manager Willie Randolph said.
Beltran returned from a strained right quadriceps on Tuesday.
"You can see he's playing at less than 100 percent," Randolph said. "He's moving gingerly out there but he's giving us the best that he has."
Yorvit Torrealba was intentionally walked to get to Tomko, who lined a 1-1 pitch to left-center for his first extra-base hit of the season and a 5-1 lead.
"I have to be tougher than I was out there for that at-bat," Ishii said through a translator.
Niekro added his seventh homer in the seventh, chasing Ishii (1-4).
Tomko (5-7) also helped himself with sacrifice bunts each of his first two times up. He is 5-for-26 (.192) at the plate this season with five RBI.
"I was just trying to make contact, just don't walk back to the dugout striking out," Tomko said.
The right-hander was lifted with the bases loaded in the eighth, but Scott Eyre struck out pinch-hitter Kaz Matsui on a high pitch to end the inning.
"Matsui chasing that, that's huge for us, because that could have swung the ballgame," said Tomko, who allowed one run and six hits, striking out five and walking two.
The Mets scored twice in the ninth off Eyre and LaTroy Hawkins, but Tyler Walker got three outs for his eighth save. He retired Mike Piazza with two on to end it.
New York had won three straight and six of eight.
San Francisco fielded an all right-handed hitting lineup against Ishii -- lefties are 1-for-28 against him this season.
It certainly worked. The erratic lefty gave up six runs -- five earned -- and a season-high 10 hits in 6 1/3 innings.
He did help himself with a two-out RBI single in the second, a blooper to left after Victor Diaz was intentionally walked. It was his second RBI in two outings.
Ishii also singled in the fifth and is 5-for-13 (.385) this season with a pair of two-hit games.
The Giants tied it with an unearned run in the third, when Torrealba reached on an error by third baseman David Wright and scored on Ray Durham's two-out single.
Torrealba was on third with one out in the fifth when he broke for the plate on a suicide squeeze. But Jason Ellison missed the sign, swung away and popped out to second.
"The bad thing is the kid didn't hit a groundball," Alou said with a smile. "He's not playing the second game - no, I'm just giving (Michael) Tucker a shot."
Beltran was in the lineup again for the nightcap. ... It was the first doubleheader of the year for both teams. ... The Giants haven't lost more than eight in a row since dropping a San Francisco-record 10 straight in June 1996. ... Pinch-hitting specialist Marlon Anderson made his fourth start for the Mets, his first at second base. ... Mets RF Mike Cameron made an outstanding catch in the seventh, robbing Moises Alou of extra bases with a diving grab at the edge of the warning track in right-center. ... The Giants grounded into two double plays. They lead the majors in that category with 59. ... San Francisco had lost six games in a row at Shea Stadium since sweeping a three-game series in 2002.