SAN FRANCISCO (AP) -- The San Diego Padres showed up in San Francisco on the verge of elimination, their hitters in a serious funk and plenty of people counting them out.
Two dramatic wins and they're right back in the mix to still win the NL West or land the wild card.
"We're back," shortstop Miguel Tejada said. "Everybody knows we don't have tomorrow."
Heath Bell stopped a Giants rally in the ninth inning and the Padres beat San Francisco 4-2 on Saturday, leaving a pair of NL playoff races in question heading into the final day of the season.
The Padres still must win Sunday to have a shot at the division title. If Atlanta then loses again Sunday to the Phillies, the Giants and Padres would both celebrate playoff berths simultaneously at AT&T Park - the winner as the West champion, loser as the wild card.
According to the Elias Sports Bureau, it would be only the second time two teams clinched postseason berths in the same ballpark. On Oct. 5, 2001, the Astros and Cardinals did it - but that was on the Friday before the season ended.
"It's one that you want to win, both sides want to win," Giants manager Bruce Bochy said. "Have to? I don't know. We're in a situation where we do have a little margin of error but we'd certainly like to win it."
Pablo Sandoval hit an RBI single with one out in the ninth, but Bell got pinch-hitter Jose Guillen to ground into a game-ending double play with runners at the corners.
Tim Stauffer gave San Diego another clutch start, and the Padres pulled within one game of the Giants in the NL West. The Padres tied Atlanta for the wild-card spot when the Braves lost to Philadelphia 7-0.
If both the Padres and Braves win Sunday, San Francisco would play at San Diego on Monday to determine the West champion and the loser would play at Atlanta on Tuesday for the wild card.
If the Padres and Braves lose, there would be a one-game tiebreaker in Atlanta on Monday night for the wild card.
"I really haven't thought about all the scenarios," San Diego manager Bud Black said. "As a group we've really thought about coming up here and winning one game."
He's feeling much better about his club's chances than he did Friday afternoon. The Padres had just dropped three of four at home to the Cubs, managing only five runs and 17 hits in the series.
"It's funny how this game works out," San Diego second baseman David Eckstein said. "We still have destiny in our hand. We're still in control. This is why we play the game."
Stauffer (6-5) allowed three hits in 6 1-3 innings. He improved 3-1 against the Giants this season, again delivering in a starting role after spending most of the season in the bullpen.
Bell took over in the ninth, and Pat Burrell doubled and took third on Juan Uribe 's double. Sandoval's single cut the Giants' deficit to two runs.
Guillen grounded to Tejada, who turned the double play. Tejada pumped his fist at pinch-runner Darren Ford after throwing to first baseman Adrian Gonzalez to end it.
"I think God is going to decide who wins," Tejada said. "I hope both (West) teams get to the playoffs."
Bell held on for his 47th save in 50 chances. He is tied for the major league lead with Giants closer Brian Wilson .
Giants starter Barry Zito (9-14) gave up consecutive bases-loaded walks in the first and was booed off the field when done after a season-low three innings.
Bochy also made an early exit - he was ejected after the sixth for arguing when Buster Posey was called out on strikes.
The Padres came into this weekend series needing a three-game sweep to have any chance of winning the NL West - without a sweep, they needed help from Atlanta losses to reach the playoffs. San Diego has won two in a row in a hostile environment where Saturday's sellout crowd of 42,653 waved orange rally towels.
"The players dig this, they really do," Black said. "There's no doubt. This is what gets guys going."
San Diego is 7-1 this year at AT&T Park.
Ace Mat Latos (14-9) goes Sunday for San Diego against Jonathan Sanchez (12-9), who is 2-5 lifetime versus the Padres but also threw a no-hitter against them last year. In August, Sanchez guaranteed a three-game sweep of the Padres but San Francisco dropped two of three.
Latos made critical comments last week about the Giants' new-look roster featuring castoffs such as Burrell, Guillen and Cody Ross . He said San Diego kept its original team intact.
"We're confident. Tomorrow we want to win," Sandoval said. "It's important for us. We want to celebrate at home."
The Padres won the first eight meetings between the rivals to start the season, then the Giants took three of four in San Diego from Sept. 9-12 - San Francisco's lineup far different than opening day.
Once again, the Giants fell behind early. They trailed by six runs on Friday night and lost 6-4, then were down 4-0 on Saturday.
Uribe hit his career-high 24th homer in the seventh for San Francisco's first run.
Zito gave up four runs, three of them earned, on five hits and four walks.
The Padres got two straight hits off Zito to start the game, and Tejada bunted on his own for a sacrifice that put runners on second and third. Zito intentionally walked Gonzalez to bring up Ryan Ludwick , who popped up to second. Yorvit Torrealba and Scott Hairston drew bases-loaded walks.
Black said Ludwick's popup could easily have provided the Giants with momentum, then the Padres stayed patient to draw the walks.
San Diego added another run in the third when Sandoval fielded Scott Hairston 's hard grounder to third and threw wildly to second as Tejada rushed home. Chase Headley singled to right and Ross threw out Hairston at third. Gonzalez, trying to score from second, crossed home at almost the same time and plate umpire Mike Everitt waved off the run. Black argued briefly.
Zito, working on six days' rest, failed to reach 10 wins for the first time since his rookie season in 2000. His 4.15 ERA is the fourth-highest of his career. He went 1-8 with a 6.72 ERA over his last 11 outings and 10 starts and only had one victory in his last 15 appearances. The stretch included a career-worst nine-game losing streak from July 21-Sept. 14.
After the first inning, Zito looked down as he walked off the mound and shook his head.
"I wanted to win for the team. We've been battling all year, coaching staff, the fans," Zito said. "To go out there and to scuffle and not be able to do that and give ourselves a chance to win, I'm extremely disappointed in myself."
Zito allowed a season-high seven walks in his lone other start against San Diego this year on May 11.
Notes: Ross had his 10-game hitting streak snapped. ... Zito walked successive batters with the bases loaded for the second time in his career. The other time was July 3, 2007. ... Stauffer earned his first career win at San Francisco in four tries. ... Bochy has been ejected four times in 2010.