The Chicago Cubs scored four runs in the ninth inning to rally and eliminate the San Francisco Giants to move onto the National League Championship Series.