CHICAGO (AP) -- Aramis Ramirez is used to playing in front of a wild crowd at Wrigley Field. Happens all the time.
But Friday's game was a little more energized than usual, a first-place showdown with the other team that plays in the same city, the White Sox. And Ramirez responded. Did he ever.
Derrek Lee and Ramirez tied the game with a back-to-back homers in the seventh off Octavio Dotel. Ramirez then sent Wrigley Field into pandemonium with a leadoff homer in the bottom of the ninth that gave the weary Cubs a 4-3 victory.
"Anytime you hit a walk-off, it's special. You just won the game," Ramirez said.
"It's great to play in front of 40,000 every day and we take advantage of it."
Ramirez lined a 1-0 pitch from Scott Linebrink (2-2) over the wall in center and the majority of the 41,106 fans -- most of them obviously pulling for the Cubs -- went home happy.
The game marked the first time the two city rivals met as first-place teams since interleague play began in 1997.
"It was a little different," Ramirez said. "They just swept the Pirates. They're in first place, we're in first place. It's kind of nice."
The two teams met in the 1906 World Series -- city fans are envisioning a rematch this season -- with the White Sox winning. Two years later, the Cubs won their second straight World Series and haven't captured another since, a 100-year drought.
The White Sox got a leadoff double from Brian Anderson in the ninth off Kerry Wood (4-1), who then retired the next three batters, striking out an agitated Pierzynski to end the threat. Pierzynski was called out on an appeal to third base umpire Mike Everett and then fired down his helmet and flipped his bat away on his way to the dugout.
That's the kind of emotion this series brings out.
"It's awesome. It's the best atmosphere you can have besides a playoff game," Pierzynski said. "Fans were great both ways. Booing and cheering: 'Let's Go Cubs, Let's Go White Sox.' Back and forth. It's a fun atmosphere. This is what baseball is supposed to be."
The White Sox, who had pounded the ball while sweeping the Pirates in their previous series, had a 3-1 lead headed into the seventh before Lee and Ramirez connected off Dotel.
Pierzynski hit a two-run homer in the third off Ted Lilly -- his fifth career homer against the Cubs as a member of the White Sox -- to make it a two-run cushion.
White Sox lefty John Danks had shut the Cubs down for six innings, allowing just five hits and a run before giving way to Dotel. The biggest problem for the White Sox, other than the home run balls from the two relievers they signed this offseason to stabilize their bullpen, was a failure to take advantage of earlier scoring chances. They left eight on base and had Lilly in several jams.
"We had a chance and we couldn't get the big hit. When you don't do that, they're going to take advantage of you. If you don't score, they're going to bury you," White Sox manager Ozzie Guillen said. "One thing about it. They have pretty good hitters and we have to score more runs."
The Cubs didn't look sleepy early on after playing in St. Petersburg, Fla., on Thursday night and not getting back to Chicago until 2 a.m. They scored a run in the first as leadoff hitter Kosuke Fukudome beat out a swinging bunt and moved to third on Ryan Theriot's sharp single to right center. Fukudome scored when Lee hit into a double play.
Dye tied it in the second with his third homer in two games, fifth in the last five and 15th of the season, a line drive that sailed over the left field bleachers and onto Waveland Ave.
Danks retired 11 straight before Fukudome's one-out single in the sixth but third baseman Joe Crede took Theriot's grounder and started the White Sox's third double play of the day. Danks went six innings, allowing a run and five hits. Lilly lasted 6 2/3, giving up seven hits and three runs.
Guillen was on a roll before the game and got in another shot at one of his favorite targets, Wrigley Field. Especially the batting cage under the right field bleachers.
"You go to take batting practice and the rats are bigger than pigs out there. You want to take a look? I think the rats are lifting weights," he said.
"That's the way it is. This is a museum. People like to come to Wrigley Field. I don't say people don't like to come here. I said, 'Ozzie doesn't like to come here.' "
Cubs manager Lou Piniella, who did a TV commercial that featured he and Guillen riding a bike together and taking turns on a trampoline -- some doubles were used in the taping -- brushed off the comments.
"If you can believe everything Ozzie says then I guess you should be . . . I haven't seen any rats around here to be honest with you," Piniella said.
The Cubs announced that ace Carlos Zambrano, who had to leave his previous start Wednesday with a sore shoulder, has a minor strain. He had an MRI on Friday. The Cubs will determine on Saturday what course of action to use for Zambrano, who will miss his next start Tuesday. ... The Cubs are now 30-8 at home. ... Dotel had allowed just two homers in 33 1/3 innings entering the game.