SAN FRANCISCO -- The Giants have played bigger games before larger crowds at AT&T Park. And the next spectator to help them win by swinging a bat or throwing a pitch will be the first.

Yet it was possible to perceive that Monday night's stimulating fan atmosphere helped carry the Giants to their improbable 5-4 triumph over the Los Angeles Dodgers, who watched their archrivals score twice in the eighth inning on grounders by Rich Aurilia and Bengie Molina that didn't leave the infield.

Already emotionally charged by the Dodgers' first appearance of the season here, the fans received an additional jolt by the surprise appearance of Barry Bonds, who watched much of the game with Giants executives in a front-row seat adjacent to the home dugout.

"The culmination of having Barry here making a homecoming, and also the first series at home against the Dodgers -- fans were fired up," Giants left-hander Barry Zito said. "They were great all night."

The Giants squandered a three-run lead for the second game in a row when Los Angeles forged ahead with four runs in the seventh. But all it took for the crowd to begin chanting "Beat L.A.!" were hits by Fred Lewis and Edgar Renteria to open the eighth.

"I feed on the positivity," said closer Brian Wilson, who overcame his blown save Sunday by striking out the side in the ninth. "Once we got the lead, you could kind of hear, just feel, the sense of what was going on in the crowd. I kind of took that with me out there and [tried] to be one with the crowd, one with the fans, and give them what they want to see, which was a victory. Not only against the Dodgers, but the first-place Dodgers."

Casey Blake's two-run homer off a tiring Zito, who blanked Los Angeles through six innings on three hits, and RBI singles by Orlando Hudson and Manny Ramirez off Merkin Valdez, making his first appearance since April 16, fueled the Dodgers' big seventh.

Then came the odd events that improved the Giants to 7-2 at home -- a startling record, given their struggles by the bay in recent years.

Lewis, who struck out in his first three plate appearances, singled to launch the winning rally against Ronald Belisario (0-2). Breaking with the pitch, Lewis sped to third on Renteria's single before Randy Winn struck out.

Up came Aurilia, batting cleanup for the first time since 2006 as Molina rested. Before the game, Aurilia admitted that he didn't fit the prototype of a power-hitting No. 4 hitter but said, "My concern is driving in runs. It doesn't matter how you do it."

He backed up his words by nubbing a grounder up the first-base line. Belisario fielded the ball and made a scooping toss from his glove to catcher Russell Martin, which was wide and late as Lewis scored.

After a wild pitch advanced the runners, Molina pinch-hit for Valdez (1-0) and hit a grounder to third base, with Renteria dashing toward the plate upon contact. Blake made the play and looked home, but opted to throw to first as Renteria scored the go-ahead run.

"Edgar did a great job on that," Giants manager Bruce Bochy said. "He got a terrific jump. We were going on [a ground ball] and he read it great. I don't think [Blake] had a shot at him."

All that remained was for Wilson, who yielded three ninth-inning runs 24 hours earlier, to record his fourth save. He whiffed Blake and pinch-hitter Blake DeWitt in succession before falling behind on the count against Rafael Furcal, 3-0. But Wilson recovered, retiring Furcal by slipping a 96 mph fastball along the outside corner.

"It shows you a little bit about what he's made of," Bochy said, referring to Wilson's resilience.

Maybe, just maybe, this game showed a little bit about what the Giants are about, too.

"We did things in that eighth inning that we need to do as a team to win ballgames," Aurilia said. We hit-and-ran, got guys in from third with less than two outs, scored the winning run on a contact play from third base with the infield in. It was great to see how it turned out tonight."