Sosa's first homer of the night, a towering blast into the first row of the left-field bleachers in the fifth inning, was the first of three consecutive solo shots by the Cubs.
His second one, a solo blast over the center-field bleachers estimated at 480 feet in the seventh, pulled him even for the first time this season with McGwire -- who went homerless in St. Louis' loss to the New York Mets on Monday.
Though the wind was blowing out at 20 mph early in the game, players said it started blowing toward right in the middle innings and was blowing toward the plate late in the game.
After the game, Cubs center fielder Brant Brown was still marveling at Sosa's second shot.
"He crushed that ball," Brown said. "That one and the one down the line at Wrigley that hit the house, those are the two farthest balls I've seen him hit all year."
Cubs manager Jim Riggleman called Sosa's second homer "majestic."
"Knowing how hard it is to hit a baseball and seeing what he's doing, it's an amazing thing," Riggleman said.
Tyler Houston added a two-run shot as the Cubs hit five homers while breaking a four-game losinstreak.
With the win, the Cubs held on to their half-game lead over the Mets in the race for the NL wild-card spot. The Giants, who have lost five straight to match their worst skid of the season, fell three games behind the Cubs.
Sosa's first homer began a streak of three straight homers in a span of eight pitches. Mark Grace followed with his 13th homer and Henry Rodriguez added his 28th.
It was the sixth time in Cubs history the club had three consecutive homers.
Sosa went 2-for-5 while increasing his NL-leading RBI total to 116. He struck out in the first and third innings, and popped to second in the ninth.
Barry Bonds hit his third homer in two games, a controversial three-run blast, and Jeff Kent added a solo shot, his 17th, two pitches later for the Giants in the third inning.
Bonds' 398th homer tied him with Dale Murphy for 28th on the career list and moved him within two homers of becoming the first major leaguer with 400 homers and 400 stolen bases.
The shot bounced off the wall just above the yellow home run line and just beyond the reach of Brown. A fan reached for the ball and appeared to touch it, leading to a short argument from the Cubs.
Bonds, who has 24 home runs this season, had homered twice Sunday night in a loss to Atlanta.
Kevin Tapani (14-7) allowed five runs on 10 hits in 5 2/3 innings for the Cubs. He has won six of his last seven decisions.
Former Giant Rod Beck, returning for the first time to the ballpark he called home from 1991-1997, pitched the ninth for his 34th save. He retired Bonds, the potential tying run, on a fly ball to the wall in right for the final out.
"It was excruciating watching him come up there," Riggleman said of Bonds' final at-bat. "He just missed it."
Giants starter Russ Ortiz (1-2) allowed six runs and six hits in five innings. The Giants have allowed 20 homers in their last five games.
"We're scoring some runs. We just can't keep them in the ballpark," Giants manager Dusty Baker said.
© 1998 SportsLine USA, Inc. All rights reserved