CHICAGO -- Nicholas Castellanos swung a fist in the air and began jumping up and down as he rounded second base on Wednesday night. He had the perfect vantage point to watch the baseball launched by Kris Bryant disappear into the left-field bleacher seats. Bryant’s two-run shot in the eighth

CHICAGO -- Nicholas Castellanos swung a fist in the air and began jumping up and down as he rounded second base on Wednesday night. He had the perfect vantage point to watch the baseball launched by Kris Bryant disappear into the left-field bleacher seats.

Bryant’s two-run shot in the eighth inning served as the decisive go-ahead blow in the Cubs’ wild 12-11 victory over the Giants at Wrigley Field. The North Siders belted three home runs on the night -- including one from Castellanos as part of a four-hit showing -- to stave off a San Francisco team trying to stay afloat in the Wild Card race.

• Box score

In the immediate wake of the victory, as Cubs fans sang in the stands and Wrigley's old walls quivered, Anthony Rizzo told Bryant that it felt like a "season-defining" win.

"That's what Rizz told me," Bryant said. "I can't disagree with him. It's one of those games where you don't feel like you're going to win, just because you're taking a lead and then giving it back. We came out on top, and there's definitely some good momentum here."

Thanks to rain in St. Louis, the Brewers pulled off an eight-inning win over the Cardinals, helping the Cubs move back into first place atop the National League Central. St. Louis is now a half-game back of Chicago, which improved to 43-19 at home with 14 wins in the past 17 games in front of the Wrigley faithful. Milwaukee sits 3 1/2 games back of the Cubs in third place.

Throughout their up-and-down campaign, the Cubs have posted double-digit runs 15 times, but the bulk of those have been blowout wins. There have been a couple of losses with 10-plus runs scored -- both coming within the first seven games of the season. What Chicago had not experienced was a knock-down, drag-out, back-and-forth, run-happy victory like this one.

That is what Rizzo meant by his postgame assessment with his teammate.

"We haven't won a game like that, really, all year," said the Cubs first baseman. "They scored, what, nine runs in the fifth through the seventh inning? Teams don't really win when that happens, so it's just a good, hard-fought, never-quit win."

Yes, that is precisely what the Giants did.

San Francisco pounded out nine runs on nine hits between the fifth and seventh innings. On the night, the Giants scored seven runs on four homers off Cubs starter Yu Darvish . Evan Longoria, Mike Yastrzemski and Stephen Vogt each launched a two-run blast off the righty, and Kevin Pillar added a solo shot. The Giants then did more damage against the bullpen.

Darvish has been on an incredible run in terms of command of the strike zone. Even in Wednesday's outing, the pitcher finished with zero walks issued. In the process, Darvish became the first pitcher in recorded Major League history (since at least 1908) to have at least eight strikeouts and no walks in five consecutive games.

On this night, though, Darvish needed the offense to pick him up.

"We haven't scored a lot of runs, I don't think, to win the game when we've given up a lot of runs," Cubs manager Joe Maddon said. "And that's got to happen on occasion. I think we've lost a couple high-scoring games, just barely."

Castellanos got things rolling with a two-run homer in the first, marking his eighth shot in 19 games in a Cubs uniform. The outfielder also became the first batter in franchise history to hit a homer in the first inning in three straight games. Castellanos added an RBI single in the second and added two more base hits before the night was done.

Kyle Schwarber launched a two-run shot -- his 29th home run of the year -- in the third. Rizzo (RBI double), Javier Baez (RBI single) and Victor Caratini (RBI single) also got in on the act. Even Darvish contributed, pulling back a bunt in the second inning before yanking a pitch into left for a run-scoring single.

"They hit pretty well," Darvish said. "And me, too."

In the eighth, Castellanos' last single was a chopper up the middle, gloved by shortstop Brandon Crawford on the run. He fired a throw to first, but Castellanos hustled up the line and eked out the hit. That set the stage for Bryant.

"If that didn't happen, who knows what sequence of pitches I would've got?" Bryant said of Castellanos' hustle. "It could've changed the whole inning."

Bryant then lifted a pitch from reliever Reyes Moronta deep to left, setting off Castellanos' celebration and changing the whole game.

Maddon was asked if he agreed that this may have been a season-defining moment for his club.

"We'll find out," said the manager. "I've been involved in moments, those seminal moments and all of a sudden things switch."