The win was the Brewers' third straight and ninth in their last 11 games.
Sogard fouled off five, two-strike pitches from Buchter before doubling on a full-count fastball to drive home Keon Broxton and Orlando Arcia to erase a 2-1 deficit.
Sogard, who was the Padres' second-round pick in the 2007 draft, had two four-hit games in the series.
He was 4-for-4 Thursday with a double, a walk and drove in the first three runs scored by the Brewers. He was 9-for-15 in the series with the two doubles, a homer, five RBIs, four runs scored and two walks, reaching base 11 times in 17 plate appearances.
The Brewers promoted Sogard, who missed all of the 2016 season with a knee injury, from Triple-A Colorado Springs last Friday.
Broxton and Arcia opened the seventh with back-to-back singles off reliever Kevin Quackenbush (0-1) and were at first and second when pinch hitter Eric Thames flew out to center, allowing both runners to advance although it looked like Margot's throw to third had a chance to catch Broxton before it was cut off.
The left-handed Buchter entered the game to face the left-handed Thames and Sogard.
Milwaukee's Zach Davies (5-2) allowed two runs on five hits and two walks with three strikeouts in six innings. Right-hander Corey Knebel got his third save.
Milwaukee added an unearned insurance run in the ninth as Broxton singled against Jose Torres and came around on a steal, a throwing error by catcher Luis Torrens and an infield grounder.
Jarred Cosart, making his first start for the Padres since going on the disabled list April 19 with a right hamstring strain, allowed one run on five hits and a walk with three strikeouts over five innings.
The Padres took a 1-0 lead in the bottom of the second when Hunter Renfroe sent a 3-and-1 pitch into the left field seats for his eighth homer of the season.
Milwaukee tied the game in the top of the fifth on a single by Sogard through the right side of the drawn-in infield.
The Padres regained the lead in the bottom of the fifth when Cory Spagenberg scored as Torrens grounded into a double play.
NOTES: Brewers manager Craig Counsell said he gave 2B Jonathan Villar a second straight start off Thursday afternoon by plan. ... RHP Paolo Espino will make his Major League debut at the age of 30 Friday night when the Brewers promote him from Triple-A Colorado Springs to pitch against the Cubs in Wrigley Field. Also expected to play Friday is 1B-OF Eric Thames, who missed the four-game series in San Diego with strep throat. Counsell said RHP Wily Peralta is ready to debut in the Brewers' bullpen . . . Padres manager Andy Green said Rule 5 rookie C Luis Torrens, 21, is the Padres' primary backup to Austin Hedges. Hector Sanchez will be a pinch-hitter and occasional catcher when he returns from the disabled list. Sanchez is starting a rehab assignment with Triple-A El Paso this weekend.