Montoya qualified a disappointing 32nd in the 43-car field. He was the first driver to win on the Northern California road circuit starting farther back than 13th.
The Colombian driver, who jumped from Formula One to the American stock car circuit late last season, got his first Cup win in his 17th start. It gave team owner Chip Ganassi his first win in NASCAR's top series since Jamie McMurray won in October 2002.
Montoya's only other NASCAR victory came earlier this year in a Busch Series race on the road course in Mexico City. He passed McMurray eight laps from the end and stayed out front to the end of the 110-lap event on the 12-turn course.
Kevin Harvick finished second for his third top-ten finish this year. Jeff Burton ran third.
Nextel Cup leader Jeff Gordon, a five-time winner at Infineon, finished seventh. Gordon has a 271-point lead over Denny Hamlin in the points standing.