Juan Uribe matched a career best with his 23rd home run and the first-place San Francisco Giants increased their NL West lead over San Diego to two games with a 4-2 victory over the Arizona Diamondbacks on Tuesday night.

The Padres lost 5-2 at home to the Chicago Cubs, leaving San Diego 1½ games behind Atlanta in the wild card. San Francisco's win eliminated the Colorado Rockies from playoff contention and gave the Giants a magic number of four to clinch their first playoff berth since 2003.

Uribe hit a tying solo drive leading off the fourth. He also had 23 homers in 2004 with the White Sox.

Jonathan Sanchez (12-9) struck out six in six innings to reach 200 Ks in a season for the first time in his career. Sanchez retired Chris Young on a called third strike to start the sixth. Sanchez joined Tim Lincecum as the first Giants righty-lefty combo to have 200 or more strikeouts since Juan Marichal and Ray Sadecki in 1968.

Pinch-hitter Nate Schierholtz hit a go-ahead single in the sixth inning for the Giants. Mike Fontenot added an RBI single in the third for San Francisco right after Andres Torres' leadoff triple. Pat Burrell singled in a run in the seventh for the Giants, who kicked off their final homestand of the year by winning for the sixth time in eight games and 17th in 25.

San Francisco ends the regular season with three games against the Padres this weekend that likely will decide the division champion.

Sanchez has been San Francisco's most reliable starter of late, going 3-1 with a 1.16 ERA over his past six starts. He allowed three hits and two runs and walked four Tuesday.

The lefty ran into trouble in the second but kept the damage to a minimum. After Adam LaRoche's leadoff single and a strikeout of Tony Abreu, Sanchez walked Miguel Montero and intentionally walked Cole Gillespie to load the bases. That brought up pitcher Rodrigo Lopez, who hit a sacrifice fly to put Arizona ahead 1-0.

When Kelly Johnson's one-out single in the eighth put runners on the corners for Arizona, Giants manager Bruce Bochy turned to closer Brian Wilson. The All-Star right-hander retired the final five batters for his majors-leading 46th save in 51 chances — and his sixth in seven when going five outs.

Lopez (7-15) went 5 2-3 innings and lost after winning his previous two starts.

Two-time reigning NL Cy Young Award winner Tim Lincecum was moved up to pitch Wednesday night for San Francisco. That way the Giants ace is available for a one-game playoff Monday against the Padres if needed — or perhaps on short rest in Sunday's regular-season finale against San Diego.

The Giants hope to have second baseman Freddy Sanchez back from a shoulder strain Wednesday.

Sanchez underwent an MRI exam during Monday's day off that revealed a mild strain in his right shoulder. He also received an injection in the shoulder.

Notes: Sanchez and Lincecum join Philadelphia's Roy Halladay and Cole Hamels as the only set of teammates with 200 or more strikeouts this season. ... Uribe's homer was No. 150 of his career. ... Wilson is two saves shy of Rod Beck's single-season Giants record of 48 set in 1993. ... The D-backs scratched rookie RHP Daniel Hudson from his Friday start against the Dodgers in Los Angeles and will shut him down for the year. An MRI showed a strain in the middle finger on his pitching hand. LHP Zach Kroenke will pitch in his place. ... Arizona manager Kirk Gibson isn't ruling out 3B Mark Reynolds — who missed his third straight game with a sore thumb — getting another start before season's end. ... D-backs OF Justin Upton, who has appeared in only four games this month because of left shoulder irritation, is likely done for the season. He will still take some live batting practice. ... Fontenot started in Freddy Sanchez's spot.