SAN FRANCISCO -- Felipe Alou had his doubts three hits would keep the Giants in the ballgame. Gutsy relief pitching made all the difference.
The game went three hours, 46 minutes, and matched a 13-inning game played by the Braves and Marlins on April 6. The Giants needed every pitcher in their pen, and even sent Friday starter Kirk Rueter out to warm up at the end.
"It's a funny game," said Alou, who was ready for a long one, even keeping two jackets handy. "You see how far three hits can take you."
The Giants, who finished with six hits, loaded the bases with none out in the 13th against Mike Gosling (0-2). Lance Niekro singled, Pedro Feliz doubled and Edgardo Alfonzo was intentionally walked before Cruz's hit scored Niekro.
"You hope you can get out of it with a popup or a double play," Gosling said. "I threw a first-pitch changeup to Cruz hoping to get him out in front, but he was right on it."
It was the Giants' first 13-inning game since May 27, 2003, also against Arizona -- won 2-0 by San Francisco. The Diamondbacks played a 13-inning game last year against Colorado and won 4-3.
Tyler Walker (1-0) pitched the 12th and 13th innings for the victory.
"I probably threw the least pitches of anybody," Walker said, smiling. "Deivi spent all day waiting to play, then got in there and made it count."
Matt Herges allowed a one-out double to Shawn Green in the 11th, then intentionally walked Chad Tracy before Scott Eyre relieved and got Alex Cintron to hit into a double play.
The Giants, in quite an offensive funk lately, had lost six of eight, so this was a big boost as they head into a weekend series against Milwaukee.
"Any win is important," San Francisco's Ray Durham said. "I'd rather have had it easier, but we'll take 'em any way we get them."
Tracy hit a three-run homer, Cintron had a double among his three hits and Luis Gonzalez and Green added two hits each for the Diamondbacks, who beat the Giants 2-1 on Wednesday.
Brian Bruney, making his majors-leading 11th appearance, walked the first two batters he faced in the eighth and later gave up a tying sacrifice fly to Feliz for the right-hander's second blown save in three opportunities.
That spoiled what would have been Russ Ortiz's first victory over his former team after eight strong innings and kept Giants ace Jason Schmidt from his first loss to Arizona in nine starts dating to a 6-4 defeat Sept. 5, 2002.
This was an exciting pitcher's duel featuring Ortiz against his old teammate Schmidt, the two of them tied for the most wins by a starting pitcher since 2003 with 37. Ortiz and Schmidt spent a year and a half together in San Francisco's rotation before Ortiz left for Atlanta following the Giants' 2002 World Series season.
Ortiz didn't allow a baserunner past first until Ray Durham singled in the sixth, went to second on a wild pitch and advanced to third on Omar Vizquel's groundout. Then, rookie Niekro sent a hanging 2-2 breaking ball from Ortiz into the left-field seats for his second homer of the year to pull the Giants to 3-2.
"It just came down to someone had to win," Ortiz said. "I felt like I only made one mistake."
Schmidt gave way to Jeff Fassero in the eighth after 107 pitches. Schmidt allowed three runs on six hits, struck out five and walked one.
The lanky right-hander retired 10 of 11 batters to start the game, allowing only a leadoff double to Troy Glaus in the second.
Then Schmidt gave up four hits in the fourth, including Tracy's third homer of the year to dead center.
"It was one pitch basically," Schmidt said.
Alou is ready to make some wholesale lineup changes to improve production, but is waiting to shuffle his batting order until he knows the status of first baseman J.T. Snow, who's nursing a right groin strain but came in to pinch-hit in the ninth and flied out.
San Francisco's Michael Tucker tossed his helmet in the 11th after lining out and got fined by home-plate umpire Paul Emmel, then Tucker was removed in a double-switch. ... Alfonzo has reached base in every game so far. ... The Giants' Snow is optimistic he will stay off the disabled list. Snow took regular batting practice, fielding grounders, ran the bases and did agility drills in the outfield. ... Alou needs two wins for 200 with the Giants.