SAN FRANCISCO (AP) _ The Giants surrounded Brian Johnson, gleefully rubbing his shaved head. Barry Bonds lifted manager Dusty Baker onto his shoulders, while fans danced in the stands.

Johnson's leadoff homer in the 12th inning set off a wild celebration as San Francisco, boosted by Bonds' three-run blast, defeated Los Angeles 6-5 Thursday to sweep a two-game showdown and tie the Dodgers atop the NL West.

The Giants swarmed around Johnson, who began the season as a backup catcher in Detroit and now has become one of the Giants' biggest heroes down the stretch.

``It's not too many times in life you get to bond with people like that,'' said Johnson, who has hit 10 homers since joining the Giants in mid-July.

Both teams have nine games left. They are not scheduled to play again in the regular season. If they are tied after 162 games, they'll have a one-game playoff in San Francisco on Sept. 29.

``That was some of the most partying ever seen at this park,'' Baker said of the crowd of 52,140, the Giants' third sellout of the season. ``It was awesome.''

Johnson connected on the first pitch from Mark Guthrie (1-4), the Dodgers' seventh pitcher. As his homer barely cleared the left-field fence, Johnson pumped both fists in the air as he rounded first base.

Johnson's hit was the only one after the seventh inning for the Giants, who left 14 runners on base. The Giants drew 10 walks in the game, while allowing none.

``It's not fun to leave the field like that, but it's part of the game and you've got to deal with it,'' said the Dodgers' Mike Piazza, whose two-run single in the seventh tied the game 5-5. ``If they got a big lift out of it, it really doesn't matter to me.''

Rod Beck (6-4) pitched three innings, his longest stint since 1992. He escaped a bases-loaded, no-out jam in the 10th as yet another chapter was added to the century-old rivalry between the Dodgers and Giants.

The Dodgers threatened in the 10th, loading the bases on three straight singles off Beck. But Beck struck out Todd Zeile and got pinch-hitter Eddie Murray to hit into a double play.

``These were great games,'' said Bonds, who hit a two-run homer Wednesday night in a 2-1 win over the Dodgers. ``Both games were exciting. Both games were fun. Both games had everybody on the edge. You can't ask for anything else.''

Bonds' 369th home run tied him with Ralph Kiner for 42nd place on the career list.

The Giants led 5-1 after Bonds' 35th homer of the season in the fifth. Los Angeles scored twice in the sixth on Eric Karros' RBI single and Zeile's RBI double, and Piazza tied the game in the seventh.

The two RBIs gave Piazza a career-high 113. Piazza, who went 3-for-6, is hitting .397 with 17 RBIs in 14 September games.

Bonds' seventh homer this season against the Dodgers came off Tom Candiotti. Bonds also tripled and scored in the first on Glenallen Hill's single.

J.T. Snow added his 26th homer leading off the fourth for the Giants.

Otis Nixon homered in the first, his only homer since joining the Dodgers in an Aug. 13 trade from Toronto.

Giants starter Terry Mulholland allowed three runs on eight hits in six innings, and still has not won any of his eight starts since July 4.

Candiotti allowed five runs on 10 hits in 4 1-3 innings.

``They obviously played better. We had our chances in the 10th and we couldn't score,'' Dodgers manager Bill Russell said. ``But we're still in first place and we came back from being down 5-1. They did what they had to do. We just have to forget about it. This isn't over with.''

Notes: Bonds had 13 RBIs in 12 games against the Dodgers this season. ... Candiotti struck out three, leaving him six short of 1,600 career strikeouts. ... Hill, who went 1-for-2 with a walk, has a .414 batting average with four homers and nine RBIs in 29 career at-bats against Candiotti. ... The Dodgers and Giants split the 12-game season series. ... Snow's homer ended a 1-for-27 slump. ... Piazza's previous career-best in RBIs was 112 in 1993. ... The Giants sold out both of the games in the series against the Dodgers. ... Beck has pitched three or more innings just five times in his career.