Trailing 2-1 after four innings, the Padres tied it up in the next frame on Will Venable's two-out RBI double.
Then in the sixth, the Padres loaded the bases off Michael Fiers (1-2) with one out on three consecutive singles by Chase Headley, Yonder Alonso and Cameron Maybin.
Baker then lined a 1-0 pitch back up the middle to drive in two runs, and the Padres went on to even their three-game series at Miller Park.
Ross Ohlendorf (1-0) tossed 4 1/2 effective innings in relief of starter Andrew Cashner to earn the victory, yielding one run on five hits while walking two and fanning five.
Huston Street earned his fifth save.
Rickie Weeks and Martin Maldonado drove in runs for the Brewers.