Pettitte pitched eight fantastic innings to win his fourth straight start and Giambi homered twice, sending New York to a 6-1 victory over the Tigers on Friday night.
"Andy really stepped up for us tonight," Giambi said. "He's been the guy to go to."
Andy Phillips hit a two-run double and Alex Rodriguez had an RBI double for the Yankees, who had lost three straight after winning nine of 10. Joe Torre earned his 2,041st victory as a manager, passing Walter Alston for sole possession of eighth place.
New York moved within five games of first-place Boston in the AL East. The Red Sox split a doubleheader with the Los Angeles Angels.
Gary Sheffield was booed even louder in his second game back at Yankee Stadium for the Tigers, who fell out of first place in the AL Central, a half-game behind Cleveland.
"We didn't do much, our entire lineup," Detroit manager Jim Leyland said.
The slugger has 11 homers this season, four since returning from a foot injury Aug. 7. His big performance came one day after commissioner Bud Selig announced he won't punish Giambi because of his charitable work and cooperation with baseball's steroids investigator.
It was Giambi's first multihomer game since Aug. 20 last year at Boston, and the 35th of his career.
"I'm fresh and I've got good bat speed," Giambi said.
The Yankees and Detroit rank 1-2 in runs -- far ahead of everyone else in the majors -- but Pettitte (10-7) tamed the Tigers all night. Throwing heavy cutters and sliders on a damp evening, the left-hander allowed one run and five hits. He struck out five and walked one.
"My command's back a little bit," Pettitte said. "Hopefully, I can carry this out for a while."
Pettitte has won six of seven decisions since the All-Star break. He is 4-0 with a 2.25 ERA this month and 43-16 in August during his career.
"We needed a big performance and he came out and gave it to us," Phillips said.
With the sellout crowd of 54,290 chanting his name, rookie sensation Joba Chamberlain threw several 99 mph fastballs and finished the six-hitter.
"It looks like it pumps him up," Torre said, then praised Chamberlain's maturity at 21 years old.
Pettitte, who hasn't allowed a homer in his past five starts, lobbied a bit to stay in for the ninth.
"I think I could have bribed my way back out there if the kid didn't need an inning," Pettitte said, chuckling.
Phillips finished with three hits, while Bobby Abreu added three soft singles and a stolen base.
The Tigers made a bold move before the game in the middle of a tense pennant race, calling up touted prospect Cameron Maybin and cutting slumping outfielder Craig Monroe -- a key member of their World Series team last season.
The 20-year-old Maybin, with only six games of experience at Double-A, was brought up with a shot to play regularly. Considered one of the best prospects in baseball, he went 0-for-4 with two strikeouts in his major league debut while batting second and playing a shaky, though errorless, left field.
"Obviously, he had a tough debut," Leyland said. "He's very talented. The tiers on the stadium, it's tougher to pick up the ball. He's going to be fine. He'll play tomorrow. I think he was probably a little anxious."
Maybin, normally a center fielder, said shifting to left was difficult.
"Oh man, it's different. The ball goes all different ways. It's an adjustment I have to make," he said. "I didn't do anything well tonight. I never let the game come to me. I'm happy to have the first one out of the way, absolutely. I was jacked up tonight. Now I can go out and relax. With repetition, everything will come along."
After rain delayed the start for 74 minutes, Brandon Inge put Detroit ahead with an RBI double in the third inning.
New York caught a big break in the bottom half. With two on and two outs, Abreu hit a routine grounder to shortstop that took a bad hop and skipped over Carlos Guillen for an RBI single. Rodriguez followed with a ground-rule double.
Phillips added a two-run double to left-center in the sixth to make it 5-1.
"I had a good bead on it. I had a great jump. I just lost it in the lights," Maybin said.
Robertson allowed 10 hits over six innings and dropped to 1-5 against the Yankees. He hasn't beaten them since July 18, 2004.
- Sheffield is 0-for-7 in the series.
- Monroe was designated for assignment.
- Yankees LF Hideki Matsui extended his hitting streak to 12 games.
- Maybin struck out on three pitches in his first at-bat.