The Cubs struck first, but the Giants scored four unanswered runs and got the outs they needed at the end to defeat Chicago on Wednesday.