The Mets trailed 3-0 entering the ninth inning, but Daniel Murphy led off with a double off closer Francisco Rodriguez (4-4), who blew his fourth save of the season. David Wright followed with an RBI single.
Duda hit the first pitch he saw from Rodriguez into the Mets bullpen in right field. It was his career-high 17th home run of the season and his third in the last four games.
Carlos Torres (5-4) pitched the eighth inning to get the win. Jenrry Mejia gave up a leadoff walk to pinch-hitter Jonathan Lucroy, but got the next three outs to record his 14th save in 16 chances.
The loss broke the Brewers’ four-game winning streak.
The home run spoiled a sparkling performance by Brewers pitcher Yovani Gallardo, who allowed four hits over 7 2-3 innings.
Gallardo, who has not won since June 19, retired 12 of the last 13 batters he faced. With two outs in the eighth inning, pinch-hitter Eric Campbell was called out on a groundball, but the call was overturned after a replay review. Will Smith relieved Gallardo and struck out Curtis Granderson to end the inning.
Zach Wheeler was just as good for the Mets as he gave up only one hit through six innings before tiring in the seventh. He pitched 6 2-3 innings, giving up one earned run and three hits and had nine strikeouts.
Milwaukee took a 1-0 lead in the sixth without a hit. Rickie Weeks walked and Ryan Braun hit a groundball that went through the legs of Murphy at second base for his second error of the game.
Aramais Ramirez grounded to shortstop Rueben Tejada, who got the out at second, but Ramirez beat Murphy’s throw to first and Weeks scored.
Carlos Gomez hit his 15th home run of the season with two outs in the seventh to boost Milwaukee’s lead to 2-0.
NOTES: Mets RHP Daisuke Matsuzaka was returned to New York on Friday to have a doctor examine his right elbow. Matsuzaka pitched two innings and gave up three earned runs in the Mets’ 9-1 loss to Milwaukee on Thursday night. . Tejada was back in the lineup two days after being hit in the helmet by a pitch thrown by Mariners RHP Taijuan Walker. He didn’t play Thursday. . Brewers 2B Scooter Gennett probably will be able return to the lineup Sunday. Gennett hasn’t played since leaving Tuesday’s game against Cincinnati with tightness in his right quad. .The Brewers will send Wily Peralta (11-6) in the third game of the series against the Mets’ Jonathon Niese (5-5).