Milwaukee had won four in a row and began the day tied with the Cubs for the second NL wild-card spot.
"We lost a tough game tonight," Brewers manager Craig Counsell said. "We battled good. Tonight maybe we didn't catch the breaks."
Rookie Seth Mejias-Brean hit his first career home run to help the Padres end a six-game losing streak.
Yates took over took to begin the ninth and walked Eric Thames to start the inning. With one out, pinch-runner Tyrone Taylor strayed too far off first base on a popup to shallow left and nearly got doubled off, but was hit in the back by Mejias-Brean's throw. Taylor went to second on the throwing error, and was stranded when Yates struck out Braun for his major league-leading 41st save.
The Brewers appeared to score the tying run on a fluke play with two outs in the seventh inning, but it was not allowed. With Cory Spangenberg on third base, Trent Grisham swung and missed at a third strike that wasn't caught cleanly. Grisham was called safe when first baseman Eric Hosmer dropped the throw from catcher Francisco Mejia, with Spangenberg crossing the plate.
But after a brief discussion among the umpires, it was ruled Grisham had kicked the ball, apparently inadvertently, on his way to first and that made it a dead ball and a strikeout.
"It's the umpire's judgment, whether the fact it hit Trent hindered the ability of the fielder to make the play," Counsell said.
Lamet (3-5), who missed the entire 2018 season after undergoing Tommy John surgery, repeatedly hit 97 mph. He struck out five of the first six Milwaukee batters -- three on three pitches each.
"I honestly try not to think about whether it's a playoff team or whether it isn't, I'm trying to prepare as best I can to face that team and do well against them," Lemet said through a translator.
After giving up his first hit of the game, a single in the third inning to Greg Garcia, Brewers starter Adrian Houser (6-7) reached for his back and the game was stopped while he stretched and was examined by the team trainer. He remained in the game.
The next batter, Mejias-Brean, in his 11th career at-bat, hit his first home run. The drive, on an 0-2 pitch, hit the top of the wall in right-center field and gave San Diego a 2-0 lead.
Keston Hiura connected off Lamet in the sixth for his 17th home run of the season.
"We've been playing great baseball this whole month, so far," Hiura said. "As much as we want to win every single game, sometimes you've got to tip your cap to the other pitcher, the other team. It's not a setback at all. It's more that we should be better next time."
Yelich broke his right kneecap on a batted foul ball at Miami on Sept. 10.
Since being activated from the injured list (Tommy John surgery) on Sept. 1, Brewers LHP Brent Suter has pitched 12 1/3 innings over six games and has a 2-0 record and 0.73 ERA. "He has pitched to a level that has exceeded everybody's expectations," Counsell said.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Top offseason spenders might include Angels, Padres, White Sox
Keith Law and Jeff Passan predict the teams that will be the biggest buyers this offseason.
Will Francisco Lindor and Kris Bryant be traded?
Keith Law and Jeff Passan predict whether the Indians and Cubs will make moves this offseason involving stars Francisco Lindor and Kris Bryant.
Will Dodgers spend for top-notch free agent this offseason?
Jeff Passan and Keith Law discuss the possible moves the Dodgers might make after another disappointing postseason.
What will the Red Sox do with Mookie Betts?
Jeff Passan and Keith Law discuss the tough dilemma facing the Red Sox this offseason: Will they keep Mookie Betts or trade him for more pitching?
Yankees, Cubs face crucial offseason decisions
Keith Law and Jeff Passan explain why the pressure is on the Yankees and Cubs this offseason to improve their rosters.
Mike Trout, Braves trio among 2019 Silver Slugger award winners
Angels outfielder Mike Trout has received his seventh Silver Slugger Award after batting .291 with 45 home runs and 104 RBIs this season.