Nick Martinez, in the mix for a spot in the starting rotation, allowed two hits over 2 2-3 innings. He struck out four without walking a batter.
Ross Detwiler, also a candidate for a starting spot, pitched two scoreless innings, allowing two hits, walking one and striking out two.
Peavy, who hit two batters, got in trouble in the third after hitting Hanser Alberto leading off. Delino DeShields, who left the game with tightness in his right hamstring, followed with a bunt single.
One out later, Gallo drilled Peavy's first pitch over the right field fence for his second homer of the spring.
Brandon Belt tripled in the sixth but was thrown trying to score on a wild pitch.