It's not clear how much time Gallardo will miss. Manager Ron Roenicke said the team will know more after he's examined by team physician Dr. William Raasch on Wednesday.
Gallardo first felt pain in the hamstring when he made a diving catch on Carlos Villanueva's bunt in the fourth. Then, the right-hander was favoring his leg after throwing a 1-2 pitch to Darwin Barney with two outs and the bases loaded in the fifth inning and the Brewers leading 2-0.
"As soon as I released it, it kind of tightened up a little bit," Gallardo said. "Tightened up enough to just, I think ... After I felt it on that pitch I figured it was going to be a little difficult to stay in there."
After Gallardo hobbled off the field, John Axford gave up a tying single to Darwin Barney that set off a five-run rally.