Aramis Ramirez broke out of his slump with a go-ahead, two-run single in the seventh inning and the Milwaukee Brewers held on to beat the San Francisco Giants 6-4 on Friday night.