Barry Zito pitched into the ninth inning on Thursday and the San Francisco Giants used a four-run fifth to down the Atlanta Braves, 5-2, in the opener of a four-game series between the playoff hopefuls.

Zito (10-8) allowed five hits, walked three, struck out five and left after allowing a pair of singles to begin the ninth. The 34-year-old lefty improved to 5-1 lifetime against Atlanta.

Hector Sanchez went 2-for-4 and hit a two-run double for the Giants, who were coming off a sweep of the Los Angeles Dodgers. They now lead their NL West rivals by three games.

Tommy Hanson (12-6) took the loss in his second start since returning from the 15-day disabled list. He was charged with five runs -- four earned -- on seven hits and three walks over 4 1/3 innings.

Zito was charged with two runs after Freddie Freeman plated Martin Prado and Chipper Jones with a double off of reliever Jeremy Affeldt.

Dan Uggla followed with a walk before Javier Lopez struck out Brian McCann. Sergio Romo then ended the threat and secured his sixth save of the season by inducing a pair of groundouts.

"When you do it by committee that's the way it goes," Giants manager Bruce Bochy said. "We have four really good guys we're comfortable with to go out there to finish off a game."

The Giants took a 1-0 lead in the third when Angel Pagan walked, stole second and slid into home with two down on Pablo Sandoval's sinking liner to left.

Pagan scored again in the fifth when he worked a leadoff walk, moved up on Marco Scutaro's base hit and crossed the plate when Hunter Pence placed a bunt single past Hanson to the right side of the infield.

Scutaro came home when Freeman couldn't handle Brandon Belt's grounder toward first base and Sanchez followed with a double down the right-field line to cap the frame.

"What a job he's done since he's assumed the leadoff spot," Giants manager Bruce Bochy said of Pagan. "He's really picked up his game since he's gone to the leadoff spot. He's playing as good ball as anybody."

The Braves, who are tied with the St. Louis Cardinals for the lead in the NL Wild Card race, have lost five of their last six games.

"The good thing is we came back and they used (three) guys there in the ninth inning so we got into their bullpen a little bit," Braves manager Fredi Gonzalez said.

Game Notes

The Giants have won each of Zito's last four appearances ... Zito held the Braves scoreless over seven innings in a July 17 victory ... Hanson suffered his first loss since July 2 ... Atlanta went 1-for-12 with runners in scoring position.