Updated

San Francisco, CA (SportsNetwork.com) - Yusmeiro Petit tossed another complete game against his former team, going the distance in the San Francisco Giants' 5-1 win over the Arizona Diamondbacks on Tuesday.

Petit was masterful, throwing an incredibly efficient 68 of his 84 pitches for strikes. The 29-year-old kept his pitch count low despite striking out a season high-tying nine batters.

"He's been a lift for us," said Giants manager Bruce Bochy. "He was hitting his spots tonight."

Petit (5-3) was charged with a run on four hits in his first complete game since just over a year ago. He tossed a one-hitter against the D-backs on Sept. 6, 2013.

The pitching performance overshadowed a career-best 5-for-5 effort at the plate from Joe Panik. Angel Pagan went 4-for-5 with three runs scored and Buster Posey drove in two runs for San Francisco, which has won seven straight games at AT&T Park.

Panik, Pagan, Gregor Blanco and Petit accounted for all 12 Giants hits.

San Francisco chased D-backs starter Wade Miley (7-11) after just two innings. Miley fell to 0-3 over his last five starts after giving up three runs on five hits and four walks.

"I felt really, really good," Miley said. "That's the most frustrating part. I felt really good in the bullpen. Just couldn't execute my fastball. Couldn't throw it close to where I wanted to throw it."

Pagan and Panik opened the bottom of the first with singles. Hunter Pence grounded out to advance the duo and Pablo Sandoval walked to load the bases for Andrew Susac, who also reached on balls to force in the game's first run.

The second inning was even rougher for Miley. Petit, Pagan and Panik all hit consecutive singles and Posey grounded into a fielder's choice, making it 2-0. Back-to-back walks to Pence and Sandoval forced in another run.

Petit's long blemish came in the fourth inning, when Ender Inciarte led off with a solo homer to right field.

An error on Inciarte in the home sixth allowed Blanco to score from second on Panik's single to left-center field, and Posey plated Pagan with a sac fly one batter later.

Petit faced the minimum in seven out of nine innings thanks to a pair of double plays.

Game Notes

Panik became the first player with five-plus hits, no runs and no RBI since Oakland's Adam Kennedy in 2009 ... Posey now has 23 RBI in his last 17 games ... Petit has allowed three runs in 23 innings in three career starts against the D-backs ... The D-backs have lost seven straight starts with Miley on the hill ... Arizona fell to 2-12 in its last 14 road games ... Prior to the game, Arizona recalled pitcher Zeke Spruill from Triple-A Reno. Spruill pitched four innings in relief of Miley, allowing two runs -- one earned -- on five hits.