Petit is also making a habit of shutting down the Diamondbacks.
The right-hander pitched a four-hitter for his second career complete game, and San Francisco beat Arizona 5-1 on Tuesday night.
Making his third start since replacing Lincecum in the rotation, Petit (5-3) faced just two batters more than the minimum and matched his season high of nine strikeouts. He needed only 84 pitches to finish the gem, the fewest in a nine-inning complete game by any pitcher in the majors this season.
Petit, who threw 26 first-pitch strikes, came within one out of a perfect game against the Diamondbacks on Sept. 6, 2013.
"That's my key -- stay up in the zone and (get ahead) in the count," said Petit, who didn't walk a batter for the fifth time in nine starts. "I tried to mix it up, every pitch. The umpire, he gave me the early pitch and that's why I got a lot of contact."
Panik became the first Giants rookie since Fred Lewis in 2007 to have five hits in one game.
"He's got a simple swing," San Francisco manager Bruce Bochy said. "He doesn't try to do too much, and he has a nice knack for getting the barrel on the ball."
Overall, the Giants have won 10 of 13.
Ender Inciarte homered leading off the fourth to end Arizona's seven-game homerless drought, but manager Kirk Gibson's club managed only three hits the rest of the way. The Diamondbacks have lost four straight.
The Giants stranded seven runners in the first three innings but took advantage of control problems by starter Wade Miley (7-11)
Miley, winless since July 30, gave up three runs and five hits in two innings. He walked four and struck out one.
"It was just an all-around bad game," Gibson said. "I didn't think (Miley) was throwing very well so I made a decision to move on and try and get someone else in there that could shut them down."
Gregor Blanco singled and scored on an error by Inciarte in left field. Posey added a sacrifice fly to make it 5-0.
Petit did the rest in his best start since his near-miss against Arizona a year ago.
He retired his first nine hitters -- five by strikeout -- before Inciarte went deep. The ball landed in McCovey Cove, the 101st splash hit since AT&T Park opened in 2000.
Petit also singled in the second -- his first hit of the season -- and scored on Posey's grounder.
THREE FOR THE BOOKS
Petit's 84 pitches were the fewest by a San Francisco pitcher in a nine-inning game. Bill Swift needed 85 against Cincinnati on Sept. 17, 1993, and Don Robinson threw 90 against Montreal on Aug. 20, 1990.
Diamondbacks: RHP Brad Ziegler will miss the remainder of the season after undergoing arthroscopic surgery on his left knee in Phoenix. ... LHP Patrick Corbin and RHP David Hernandez each played catch for the first time since having elbow surgery in the spring. ... Arizona called up RHP Zeke Spruill from Triple-A Reno.
Giants: 1B Brandon Belt is scheduled to fly to Pittsburgh on Thursday to see a concussion specialist. Belt, on the disabled list since Aug. 8, could resume baseball activities this weekend.
Diamondbacks RHP Josh Collmenter (10-7) is one win shy of his career high. His 103 strikeouts are already a career best.
Giants RHP Ryan Vogelsong (8-10) has a 5.51 ERA in three starts against Arizona this season.