NEW YORK (AP) -- Johan Santana got out of the fifth inning as rain came down in waves at Shea Stadium.
The downpour ended Santana's night early, but his shortest outing of the season still lasted long enough to end his frustrating losing streak.
Santana limited punchless San Francisco to three hits before departing after a rain delay, and the New York Mets beat the Giants 5-0 for their fifth straight win Wednesday.
"It seems like every time that I get to start a game here it rains or something happens with the weather," said Santana, who hadn't won in his last six starts. "Can't control Mother Nature but I was like 'OK, I guess this time it helped me out a little bit so it was a good thing.' "
"Right now everything is there," Santana said. "We just have to continue to do what we've been doing."
The Mets did get some bad news Wednesday night about injured left fielder Moises Alou, who left a rehab game for Double-A Binghamton with cramping in his left hamstring. A team spokesman said Alou was coming back to New York to be re-examined by doctors Thursday morning.
The Giants have lost four of five and were shut out for the second straight game for the first time since Oakland did it June 9-10 last year, according to the Elias Sports Bureau. They haven't scored since Ray Durham's ninth-inning sacrifice fly in Sunday's 5-3 loss to the Los Angeles Dodgers.
"We're sputtering," said manager Bruce Bochy, who promised a different lineup for the series finale against New York. "No question about it. They're pitching well but you expect that here. We're going to have to figure some way to get some runs on the board. We've hit a little skid. The last three games we haven't played well."
Santana (8-7) was 0-4 despite a terrific 2.48 ERA in his previous six starts, leading the two-time Cy Young Award winner to say he was doing his job after a close loss to the Yankees. It was only the sixth time in his career he has lost three or more consecutive decisions -- he has never dropped five in a row.
The left-hander walked three and struck out five in his shortest outing since he pitched three innings in his last start for Minnesota, a 9-4 loss at Detroit on Sept. 26.
"It was good to see him get a 'W' tonight," manager Jerry Manuel said. "I think he'll run off a big streak for us."
The Giants managed only three hits for the second straight night.
"Any time you get [Santana] out of a ballgame it's a positive for your club," said Rich Aurilia, who went 1-for-4 for San Francisco. "But Heilman came in and threw well, then Sanchez and Smith. We didn't do anything with them."
New York took the lead in the fourth against Jonathan Sanchez (8-5), who was 5-0 with a 3.00 ERA in his previous six road starts. Delgado doubled with two outs and Fernando Tatis kept the inning alive with a walk. Castro then hit a 1-2 pitch to left for his third homer.
Santana got two quick outs in the fifth before it started raining heavily with Durham at the plate. The water-logged crowd of 48,896 groaned as Durham walked, but cheered when Randy Winn flied out to end the inning on the first pitch of the at-bat, making it an official game.
"It's always good to get a win but especially this time after everything that we have been through," Santana said.
Santana wanted to continue but the Mets decided to take him out after a 42-minute delay, and the left-hander said pitching coach Dan Warthen left open the possibility he could pitch Sunday on short rest before the All-Star break.
Sanchez also was out when the game resumed. The left-hander allowed three hits, walked three and struck out six.
New York scored just 12 runs in Santana's previous six starts.
The Mets placed RHP Tony Armas Jr. (strained abdominal muscle) on the 15-day disabled list and recalled RHP Carlos Muniz from Triple-A New Orleans. ... Manuel said RHP John Maine (left forearm cramp) is fine and will start Thursday against LHP Barry Zito and the Giants. ... The Giants likely will face new Cubs RHP Rich Harden on Friday or Saturday and newly acquired Brewers LHP CC Sabathia in their first series after the All-Star break. "Perfect timing isn't it?" Bochy cracked.