Gallardo (3-1) yielded a pair of runs (one earned) on just three hits, walked two and struck out five as Milwaukee took the first of a three-game set at Miller Park.
His bases-empty blast in the fourth put Milwaukee ahead 6-2 and was the first of back-to-back shots with Norichika Aoki.
Jean Segura went 3-for-5 with a two-run homer and Yuniesky Betancourt added a solo shot among his three RBI.
Martin Maldonado and Carlos Gomez also went deep as the Brewers pounded out 13 hits.
Pirates starter Wandy Rodriguez (2-1) was lit up for seven runs on six hits over just 3 2/3 frames.
Garrett Jones provided a two-run homer for Pittsburgh.
Notable deaths of 2014 [PHOTOS]