SAN FRANCISCO -- Moises Alou can imagine the frustration Barry Bonds must experience walk after walk.
Having Alou's big bat behind him makes all the free passes a little more tolerable.
Alou, one player the Giants have counted on to come up big behind Bonds, hit a three-run homer in the first inning and then had a two-run single in the seventh.
"I didn't think it was going to be that bad," Alou said of the constant walks to Bonds. "I'll take them. As many chances as I have to drive them in, I'm going to have a good year. ... I feel sorry for the guy. He comes here to play the game and doesn't get to play it."
Matt Cain carried a perfect game into the sixth before Kaz Matsui singled up the middle to start the inning for the Mets' first baserunner.
The 21-year-old Cain (1-2) matched Tom Glavine and is showing he's finally coming around after his early season struggles, though he did face some challenging outs in the later innings and committed two errors trying for pickoffs at first.
Jose Reyes and Paul Lo Duca hit consecutive RBI singles in the sixth, then center fielder Randy Winn robbed Carlos Delgado of a hit with a leaping catch against the wall to end the inning and preserve the Giants' 3-2 lead.
Cain didn't walk a batter for the first time this season and struck out three in seven innings, allowing two runs and five hits for his first win of the season.
"I felt really good last time, too, but I was able to keep it more together this time," Cain said. "I got strike one and put them on their heels."
Matsui and Xavier Nady had two hits each for the Mets, who lost consecutive games for only the second time this season.
Bonds went 0-for-1 with three walks -- two intentional -- two days after hitting his first home run of the season and the 709th of his career Saturday at Colorado.
After Bonds was intentionally walked in the first -- the 617th of his career -- Alou followed with his fifth home run of the season on a drive into the left-field seats. On Bonds' 11 intentional walks this season, 18 runs have scored afterward.
"I didn't do anything," Bonds said, declining to talk to reporters afterward.
Bonds grounded out weakly to first in the fourth, then walked on a full-count offering from Glavine in the sixth with chants of "Barry! Barry!" resounding through the stadium. He received another intentional free pass in the seventh before Alou's two-run single broke the game open.
"They're never going to pitch to the guy," Alou said.
Glavine (2-2) allowed six runs and six hits in 6 1/3 innings after having given up only one earned run in his previous 14 innings for a 0.64 ERA. He saw his ERA rise from 1.38 to 2.78.
"With three balls, Willie told me to put him on," Glavine said of the first-inning intentional walk. "That took care of it for me. I was intent on trying to make pitches and get back. ... Regardless of what his numbers say, he's still capable of doing a lot of things. He's the guy you don't want beating you."
Bonds is six homers shy of passing Babe Ruth and 47 from breaking Hank Aaron's mark of 755.
He acknowledges passing Aaron has become a long shot.
"I never chased Hank to begin with," Bonds said before the game.
"It's all if. Everything's if, right?" he said of how long his body will allow him to keep playing. "How do I feel? I feel sore, but I'm going to hang in there. ... When you become an older player, you become day to day. Whenever I wake up and say 'That's it,' that's the day."
The Giants are 9-2 this season with both Bonds and Alou in the starting lineup. Alou has 18 RBI in 19 career games batting behind the seven-time NL MVP.
"We always have big rallies when they walk him, even before Mo was here," said Giants manager Felipe Alou, the father of Moises.
Giants LHP Noah Lowry, on the DL since April 7 with a strained right muscle on his right side, plans to face live hitters Tuesday -- another significant step in his recovery. ... Mets OF Carlos Beltran, who celebrated his 29th birthday, did not start for the fourth consecutive game because of discomfort in his right hamstring. ... Giants 2B Ray Durham was limited to hitting and throwing Monday and wasn't in the lineup a day after straining his left hamstring in the sixth inning against the Rockies. ... Giants SS Omar Vizquel celebrated his 39th birthday. ... Jason Ellison notched his first hit of the year for the Giants with a pinch-hit single in the seventh. ... After the game, the Giants placed RHP Brian Wilson on the 15-day DL with a strained left side muscle. They will recall RHP Jeremy Accardo on Tuesday from Triple-A Fresno.