The right-hander boosted his bid for a role on the staff as a long reliever and spot starter. He gave up two hits before the Giants' bullpen did the rest with five hitless innings.
Petit was 4-1 with a 3.56 ERA in eight games (seven starts) last year. He said he had one of his better spring training games in terms of location.
Oakland right-hander Sonny Gray also had a solid outing in his fifth start of the spring, giving up an unearned run and three hits with seven strikeouts and a walk in 5 2-3 innings.
Oakland had three errors and only two hits.
''When you have more errors than you do hits, you're not going to do very well,'' A's manager Bob Melvin said.
Athletics: Gray made a strong impression as a rookie late last season, going 5-3 in 12 games (10 starts) with a 2.67 ERA. The team's No. 1 draft pick in 2011 (18th overall) appears to be picking up where he left off.
''He had a real good two-seam and change, and he's not afraid to throw the changeup when he gets in trouble,'' Melvin said.
Giants: Petit said he had trouble with his location earlier this spring, ''but it is getting better.''
''I am getting stronger and working on my mechanics,'' he said.
He kept his curveball low, almost in the dirt, ''and I was throwing it for strikes,'' Petit said. He pronounced himself ready for ''whatever role they give me.''
Athletics: Right fielder Josh Reddick, who robbed Giants newcomer Michael Morse of two home runs in a visit to Scottsdale early this spring, might not have been able to do that Friday night.
Reddick left the game in the bottom of the third inning after the one-day contact lenses he was wearing began to affect his vision. Melvin took him out as a precautionary measure.
Giants: Morse, who has been slowed by a strained calf, was in the starting lineup and was hitless in two at-bats. The team will see how he bounces back Saturday.
Meanwhile, second baseman Marco Scutaro had a second epidural injection to help him deal with his back discomfort. He played in his first game earlier in the week but hasn't played since. His status remains uncertain and he could begin the season on the disabled list.
CAIN IS ABLE
Matt Cain, the Giants' No. 2 starter, bounced back a bit after giving up seven runs against the A's last week. He pitched six innings against the Angels' Triple-A affiliate, giving up three runs and three hits with one walk and four strikeouts.
Hunter Pence scored the Giants' first run in the fourth inning when he reached on an error and came home on Joaquin Arias' single.
Two more runs scored in the eighth. Tyler Colvin led off with a single and scored on a triple by Blanco, who came in on Crawford's sacrifice fly.
TALE OF TWO CLOSERS
Oakland's new closer, Jim Johnson, gave up the two eighth-inning runs on two hits. He had not allowed a run in four of his six previous outings.
Giants closer Sergio Romo, who struggled early this spring, pitched a scoreless ninth and struck out two to earn his first save.