(The Sports Xchange) - Conor Gillaspie broke a scoreless tie with a three-run homer in the top of the ninth inning on Wednesday as Madison Bumgarner threw a four-hit shutout as the Giants beat the New York Mets 3-0 in the NL wild-card game.

The Giants, who won the World Series in 2010, 2012 and 2014, advance to the National League Division Series against the Cubs, who are seeking their first championship since 1908. Game One is scheduled for Friday at Wrigley Field.

The Giants have won their last six win-or-go-home games dating back to the 2012 NLDS.

Bumgarner allowed two walks while striking out six and throwing 120 pitches, 79 for strikes. He has allowed one run in his past 30 postseason innings dating back to the start of the 2014 World Series.

In three appearances in winner-take-all postseason games, he has not allowed a run in 23 innings.

Bumgarner was one batter away from being lifted in the top of the ninth. Brandon Crawford led off with a double against losing pitcher Jeurys Familia. After Angel Pagan struck out, Joe Panik worked a walk to bring up Gillaspie, who was in the lineup because Eduardo Nunez has a hamstring injury.

With Jarrett Parker on deck to hit for Bumgarner, Gillaspie homered well beyond the right field fence. Third base coach Roberto Kelly was so excited, he was two-thirds of the way down the third base line when he exchanged high fives with Gillaspie.

Bumgarner then set the Mets down in order in the ninth.

He slapped his left hand into his glove as center fielder Denard Span caught the final out.

Mets right-hander Noah Syndergaard carried a no-hitter into the sixth inning but didn't factor into the decision despite seven scoreless innings.

Syndergaard allowed just two hits and three walks while striking out 10.

Neither team got a runner past first base until T.J. Rivera led off the fifth with a double. However, he got caught in a rundown between second and third on Rene Rivera's one-out grounder.

The Giants got a runner to second in the sixth, when Span broke up Syndergaard's no-hitter with a two-out single. Span stole second, and Brandon Belt followed with a long fly to center, but Curtis Granderson made the catch as he crashed into the wall.

The Giants loaded the bases with two outs in the eighth, via a single and two walks (one intentional) off Addison Reed, but Hunter Pence struck out.

The Mets got a runner to second with two outs in the eighth, when pinch hitter Ty Kelly singled and advanced on a Jose Reyes groundout before Asdrubal Cabrera lined back to Bumgarner.