SF Giants second baseman Joe Panik delivered a go-ahead double in the bottom of the eighth to help beat the Chicago Cubs.