For Milwaukee, the squandered opportunities started early.
Twice in the first two innings, Brewers players tripled with less than two outs and failed to come home to score. Right fielder Norichika Aoki led off the game with a three-bagger down the first-base line, but Giants left fielder Melky Cabrera gunned him down following a Morgan flyout.
In the second inning, catcher Jonathan Lucroy tripled to right-center field with one out, only to see Rickie Weeks strike out and Taylor Green fly out behind him.
Milwaukee had a runner in scoring position again in the third inning with one out after starting pitcher Shaun Marcum's double, but Aoki struck out and Morgan grounded out to second base to end the inning.
"We've been talking about runners in scoring position, and we need to get them in," Brewers manager Ron Roenicke said. "Sometimes you just need to put the ball in play, and we're not doing that certainly as often as we'd like to."
Roenicke said he was encouraged with the number of baserunners the Brewers had Tuesday night, even if they didn't always come around to score. And, down 4-0, Milwaukee eventually capitalized on a scoring chance in the fourth inning, when Weeks doubled to left-center field, scoring Lucroy, who also doubled, and Aramis Ramirez to cut the Giants lead in half.
But on a night when San Francisco took advantage of every opportunity, scoring six runs on five hits, the Brewers needed a little bit more.
Marcum (2-3) allowed just five hits in six full innings, but two of the hits were two-run homers in the fourth and sixth innings. He also surrendered two runs in the first inning on a Buster Posey double and a sacrifice fly by Angel Pagan.
It was the third game in a row the Brewers gave up at least one run in the first inning, and Lucroy said that can be hard to come back from.
"That momentum is a big thing in baseball," he said. "We were fighting to get that momentum back, and we got it back. But then we got it taken away from us again."
Posey's sixth-inning home run, which sent the momentum back to the San Francisco side and put the Giants up 6-2, gave him six RBIs and two homers in the first two games of the series.
"I see the ball well here, and -- I don't know," Posey said. "No real great scientific explanation."
For Marcum, in the three innings he didn't allow a run, no runners reached base. However, he walked batters before each home run and surrendered three hits in the two-run first inning.
"I made three mistakes, and they hit them," Marcum said. "The walks obviously hurt me, but those guys scored, and other than that, it's just locating the ball when I fall behind in the count and making good pitches."
Cain gave up four earned runs in seven innings and recorded the win for the Giants, who moved to 23-20 on the season.
Ryan Braun, in action after leaving Monday's game with a tight right groin, extended his hit streak to 11 games with an RBI single in the bottom of the seventh. The Brewers scored two runs that inning, with the first coming on Aoki's double that brought Milwaukee to within three runs.
It would not be enough to complete the comeback, though.
With the loss, the Brewers (17-26) are guaranteed to lose their third straight series and have now dropped eight of their last 10 games.
Much like his manager, Morgan said it was good to see players have quality at-bats Tuesday night. But he also said those at-bats have to turn into production soon. Unfortunately for Morgan and the Brewers, he's not sure what it will take for that to happen.
"Your guess is as good as mine, man," he said. "I guess just plugging away. Just got to stay positive. You have to stay positive even though it's getting late now."