The Milwaukee Brewers, in their present form, are still far from a well-oiled machine.

But they've been playing much better baseball, and the results are beginning to show.

Riding another strong start by Kyle Lohse and then getting some timely hitting in the ninth inning, the Brewers assured themselves of their first series victory on the young season on Wednesday night by beating the San Francisco Giants, 4-3, at Miller Park.

Blake Lalli, with the team for all of eight days, delivered the key blow, a pinch-hit walk-off single to left off reliever Santiago Casilla that scored pinch runner Josh Prince and gave the Brewers their third straight win after a 2-8 start.

"We'll see as it goes on," manager Ron Roenicke said when asked if his team had finally gotten over the hump. "But I think where we are, and the personnel that we've got out there, if we battle like this every game I'm going to be happy."

The game-winning rally began with Jonathan Lucroy singling to center field off Casilla. He was replaced on the bases by Prince, who was unable to be moved up to second initially when Alex Gonzalez fouled out to first base on a bunt attempt.

Carlos Gomez was next up and sent a roller into the hole at shortstop. Brandon Crawford rushed in to field it but then uncorked a wild throw to first base that allowed the runners to move up to second and third for Yuniesky Betancourt.

The Giants walked him intentionally to load the bases, leaving Roenicke with two options: the left-handed-hitting Lalli and right-handed-hitting Martin Maldonado. Roenicke sent Lalli to the plate, and Giants manager Bruce Bochy stuck with the righty Casilla, who threw a first-pitch fastball that Lalli hit deep.

"That one was fun," said Lalli. "If you're coming off the bench, that's the situation you want to be in - a chance to win the game. He's an aggressive pitcher, so I was definitely looking to swing early."