Pinch-hitter Aramis Ramirez singled to drive in the winning run with two outs in the bottom of the ninth and the Chicago Cubs beat San Francisco 2-1 on Wednesday night to end the Giants' seven-game winning streak.