Huff got a helpful carom to circle the bases. Eli Whiteside hit a three-run shot later in the second inning and Aaron Rowand homered a few innings after them.
Sanchez (1-0) matched his career best with 11 strikeouts in eight scoreless innings. The Giants improved to 7-2, their best start since beginning 8-1 in 2003 — their last playoff season.
Huff led off the second with a drive that hit the arch on the facade in right-center, known in this pitcher-friendly park as triples alley. The ball then ricocheted into right field and gave Huff ample time to round the bases.
Huff slid into home, but it wasn't necessary. This was the first homer of the year for San Francisco's new cleanup hitter.
The Giants' Nate Schierholtz hit the last inside-the-park homer here last June 14 against Oakland. Seattle's Ichiro Suzuki did so during the 2007 All-Star Game at AT&T Park.
It was the fourth inside-the-park homer in regular-season history at the ballpark, which opened in 2000.
Sanchez, who pitched a no-hitter against San Diego last July 10, held the Pirates to three hits. He allowed a single to Lastings Milledge in the first and not another hit until Ronny Cedeno's double to start the sixth.
Sanchez escaped a bases-loaded jam in the sixth on the way to his first career win over Pittsburgh in five appearances. It marked his fourth career outing with 10 or more strikeouts. The left-hander received a rousing standing ovation when he walked off the mound after the eighth.
Manager Bruce Bochy turned to closer Brian Wilson for the ninth because he needed work and Sanchez had thrown 109 pitches. Sanchez walked three.
Sanchez also had an infield single in the second for his first hit of 2010 and 10th of his career.
Huff and Whiteside each added doubles for San Francisco. Pablo Sandoval saw the end to his 12-game hitting streak dating to last season.
Charlie Morton (0-2) endured another rough day in his second start of the year.
With a 21.60 ERA coming in, the right-hander was tagged for six runs and eight hits in six innings.
NOTES: First-year Giants hitting coach Hensley Meulens was away from the team to be with wife, Gyselle, for the birth of their son, Elijah, on Wednesday morning. ... Pirates RHP Ross Ohlendorf will likely be scratched for his scheduled start Saturday vs. the Reds because of back spasms that began Friday. He had been set to throw a bullpen session Wednesday morning but only played catch instead. "He felt good, but it's pretty unlikely he'll pitch Saturday," manager John Russell said. Ohlendorf could be headed for the DL. ... Whiteside started at C as starter Bengie Molina got the day off, giving him two days to rest with Thursday's off-day. ... As the Giants hit the road to face the Los Angeles Dodgers starting Friday, Eugenio Velez now has a correctly spelled gray jersey. His uniform his read "San Francicso" during the season-opening series at Houston last week. Longtime equipment manager Mike Murphy confirmed the new uniform had arrived.