San Francisco pulled out the see-saw affair in the bottom of the ninth on a sacrifice fly by Juan Uribe that scored Aubrey Huff, who started the one-out rally after Sanchez led off lining out to right.
Sanchez, a three-time All-Star and a former National League batting champion, went one for five with a run scored Thursday night. He's batting .235 in the series.
The former Burbank High star gave San Francisco a 1-0 lead in the first after he singled with one out and moved to third on a pair of wild pitches thrown by Joe Blanton. He scored on a two-out hit by Buster Posey.
Sanchez, who was acquired by San Francisco from the Pittsburgh Pirates in 2009, grounded out in the third before lining out to center in the fifth and popping up to shortstop with runners on first and second to end the seventh.
Sanchez, who helped San Francisco win the National League Western Division championship, also handled all four of his fielding chances. He turned an inning-ending double play in the seventh with the score knotted at 5.
The Giants last appeared in the World Series in 2002 and are seeking their first championship since 1954.