The bases were loaded with two away in the seventh when reliever Mike Gonzalez uncorked the wild pitch that allowed two runs to score.
That turn of events made a winner out of Wade Miley (1-0), who allowed one run over six innings while striking out eight.
J.J. Putz worked around a leadoff walk in the ninth to collect his first save.
Milwaukee's lone run came on a homer by Jean Segura in the fourth that forged a 1-1 tie.
Burke Badenhop (0-1) took the loss, retiring just one batter in the seventh and putting the runners on base who scored on the wild pitch by Gonzalez.