SAN FRANCISCO -- Yusmeiro Petit had all of an hour to prepare for his spot start, and he hadn't thrown off a mound for seven days while only playing catch. There was no time to study San Diego's hitters, either.
"That's my job," said Petit, who was one out from a perfect game last September against Arizona shortly after joining the rotation. "I'm prepared for it any time for that, one moment before the game telling me, 'You're going to start the game.' I've done it before. It's normal for me."
Cain was scratched after cutting the tip of his right index finger. Cain was in the clubhouse kitchen making a sandwich and had a knife in his hand when the utensil dropped. Cain tried to catch it and cut his finger about a half-inch at the tip. He took batting practice but then tried to throw and kept opening the cut.
He expects to make his next start, Monday at Pittsburgh.
"It's obviously really, really bad timing," Cain said. "Petit did an unbelievable job today. He picked it up, and the guys scored a bunch of runs. Hopefully this isn't a big deal ... and it should be fine in a couple days."
Petit (2-1) didn't allow a hit until Everth Cabrera's leadoff single in the fourth.
Hector Sanchez, starting at catcher with Posey at first base, hit a two-run single and a sacrifice fly.
Petit allowed three hits with four strikeouts and no walks.
It was his first start not allowing a run since he tossed a one-hitter last Sept. 6 at home against Arizona. He lowered his ERA from 3.68 to 2.61.
The Giants said Cain wouldn't require stitches.
"What a great effort," manager Bruce Bochy said of Petit. "Any time you lose your starter and the swing guy goes in there and gives you six innings like that, that's such a big lift for the club."
Cain, who pitched a perfect game two years ago at AT&T Park, will finish winless in April. He is 0-3 with a 4.35 ERA in five starts.
Pagan sent a 1-1 pitch from Eric Stults (1-3) just inside the left-field foul pole for his second homer, then Posey hit his sixth one out later.
It was Pagan's seventh career leadoff homer and first since May 1, 2013, at Arizona.
"Tonight I didn't execute many pitches. I was down in the zone the first time I played them," Stults said. "I knew they were probably going to be aggressive. They usually come out swinging early."
Stults was done after 2 2/3 innings, allowing five runs and seven hits.
San Diego will try to win Wednesday's rubber game for their first road series victory this year and snap a nine-series winless streak at AT&T Park dating to a three-game series here Oct. 1-3, 2010, one that sealed the Giants' division title on the way to the city's first World Series championship.
Padres reliever Donn Roach doubled in the sixth for his first major league hit. ... Home run king Barry Bonds made an appearance at the ballpark. ... Padres OF Seth Smith was available off the bench but missed his fourth straight start as he nurses a strained groin sustained Thursday night against the Nationals. Black said it was "a very good chance" he could start Wednesday. ... Giants RHP Tim Hudson tries for his fourth victory, facing LHP Robbie Erlin (1-3). ... The Giants improved to 11-1 when scoring first. ... It was an usually warm 76 degrees at first pitch.