The Milwaukee Brewers will never forget what CC Sabathia did for them in 2008.

But business is business.

Smacking three home runs off Sabathia in the early going and rallying late after the New York Yankees rallied to tie the score, the Brewers escaped with a 5-4 victory Saturday night at Miller Park before a sellout crowd of 43,085.

The triumph put an end to the Brewers' first three-game losing streak of the season.

"It's good for baseball to have (Sabathia) out there," said second baseman Rickie Weeks, a close friend of the Yankees' lefty and the player who delivered the decisive hit off New York's bullpen.

"He was good for us, so to go out there and compete against him was fun."

The victory came with a big price, however. Third baseman Aramis Ramirez injured his left hamstring on a fielding play in the fourth inning, and by all appearances is headed for the disabled list.

"He pulled it pretty good," said manager Ron Roenicke. "We'll know a little bit more tomorrow but he felt a pop."

The Brewers have been playing for nearly two weeks without Ryan Braun, out with an oblique strain, and are facing a suspension of Carlos Gomez in the coming days. Braun is eligible to come off the DL on Monday and might swap places with Ramirez.

Making the pill even tougher to swallow was that Ramirez was on the verge of snapping out of a prolonged slump with a single and home run in two at-bats before the injury.

"It's tough any time you have to leave the game because of injury," said Ramirez. "I don't know how bad it is. I've been 16 years in the big leagues and never had a hamstring injury. I don't even know what to expect. It's pretty sore right now."

Sabathia took the mound at Miller Park for the first time since the final day of the 2008 season, when he pitched the Brewers to a wild-card playoff berth, snapping a 26-year postseason drought. And leadoff hitter Carlos Gomez gave him a rude welcome back.

Jumping on a 1-1 fastball from Sabathia, Gomez crushed a home run off the glass panels of the stadium club down the left-field line. The 462-foot blast was the fourth leadoff homer of the season for Gomez and sixth of his career.

The Brewers would add two more homers and three runs off Sabathia in the third inning when Jonathan Lucroy and Ramirez knocked consecutive pitches out of the park. Only one of the four runs off Sabathia (5.28 ERA) was earned during his 5 1/3 innings of work but that did little to help him shake out of his pitching slump.

Brewers starter Kyle Lohse had what he called a "weird outing", allowing eight hits and three runs (two earned) over six innings, departing with a 4-3 lead.

"I never felt out of control of any of the situations," he said. "They made me work hard to get through those innings but I still had plenty to go out and get the seventh if that situation had come up."

But, with the bases loaded, one down and the Yankees going to reliever Dellin Betances in the bottom of the sixth, Roenicke pulled Lohse in favor of pinch-hitter Scooter Gennett, who struck out on three pitches. Gomez also went down swinging and it remained a one-run game.

"I told Scooter I could have done that," joked Lohse, disappointed that the young second baseman wasn't at his locker to hear the rip.

After the Yankees knotted the game, 4-4, on Alfonso Soriano's seeing-eye single in the top of the seventh off reliever Zach Duke, who otherwise did fine work once again, the Brewers wasted no time in recapturing the lead. Lucroy doubled with one down off Alfredo Aceves, was balked to third an out later and scored when Weeks singled through the left side.

It was the biggest hit of the season for Weeks, who only starts against lefties these days and was relegated in recent weeks primarily to pinch-hitting duty. Despite losing the No. 1 job at second to Gennett, Weeks has kept his mouth shut while declining to entertain the thought of playing another position.