With one out in the first inning, Josh Rutledge tripled to left-center field, the first of three extra-base hits Cain yielded. Carlos Gonzalez's groundout scored Rutledge.
Wilin Rosario's two-run homer, which immediately followed Todd Helton's one-out single, lengthened Colorado's lead in the second inning.
"He tried to surprise me high on my hands," Rosario said of his home run. "And I surprised him."
It didn't matter to Cain that this game counted for nothing. "You're still looking to make good pitches and win," he said.
The Giants received a second-inning RBI single from Minor Leaguer Ryan Cavan, a late replacement in the lineup when second baseman Marco Scutaro reported back stiffness. Cavan also belted a solo home run in the eighth inning.
Dexter Fowler tripled and scored on Troy Tulowitzki's two-out single in the third, but the Giants responded with a run in their half of the inning as Buster Posey singled home Hunter Pence.
San Francisco narrowed the difference to 4-3 in the fifth. Pence drew a leadoff walk, advanced on Joaquin Arias' third single of the evening and came home on Francisco Peguero's double.
The Rockies padded their lead in the seventh as Jonathan Herrera's two-out triple off Giants reliever Ramon Ramirez scored Reid Brignac.
The Rockies pulled away with five runs in the eighth inning, striking with two out and nobody on base. With the bases loaded, Dan Runzler walked in a run and wild-pitched another home before ex-Giant Charlie Culberson lined a two-run single and Corey Dickerson grounded an RBI single.
Giants up next: Left-hander Madison Bumgarner will pitch in a Minor League exhibition Friday to build up his pitch count and avoid overexposing him against a National League West foe, in this case Colorado. Facing a Rockies split-squad at Salt River Fields instead will be right-hander Chris Heston, MLB.com's eighth-rated Giants prospect, with coverage on Gameday Audio. Heston, who already has been sent to Minor League camp, was 0-1 with an 8.10 ERA in three previous Cactus League appearances, which didn't include a strong three-inning outing in a "B" game against Arizona.
Chris Haft is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.