Cubs rally in the 9th, beat Giants and advance to NLCS

Chicago Cubs' Ben Zobrist (18) celebrates with Jason Heyward, left, and Anthony Rizzo after scoring during the ninth inning of Game 4 of baseball's National League Division Series against the San Francisco Giants in San Francisco, Tuesday, Oct. 11, 2016. (AP Photo/Marcio Jose Sanchez)

SAN FRANCISCO (AP) – Javier Baez’s tiebreaking single capped a four-run rally in the ninth inning, and the Chicago Cubs beat the San Francisco Giants 6-5 on Tuesday night in Game 4 to win their NL Division Series.

Chasing their first World Series title since 1908, the Cubs will open the NL Championship Series at home Saturday against the Los Angeles Dodgers or Washington Nationals. That matchup is tied 2-all heading into the deciding Game 5 on Thursday.

Held to two hits over eight innings by Matt Moore, the Cubs trailed 5-2 before coming back against a beleaguered bullpen that sabotaged San Francisco one last time.