Cain was just activated to pitch Monday night and allowed three runs, five hits and five walks in 3⅔ innings in San Francisco's 11-5 win against Milwaukee.
He had missed his previous two starts with the hamstring injury. Cain pitched Monday on the fourth anniversary of his perfect game against the Houston Astros.
But shortly before game time Tuesday night, the Giants announced Cain had returned to the DL. He was originally hurt on the second-to-last pitch he threw to Gerardo Parra on May 27 at Colorado.
Also, left fielder Angel Pagan came off the DL from a strained left hamstring.
Right-hander Chris Stratton was recalled from Triple-A Sacramento and available to face the Brewers.