The Brewers had a two-run lead going into the ninth inning, and closer Francisco Rodriguez was on the mound. But for only the fourth time this season, Rodriguez failed to convert a save.
He couldn't hold the lead, and the New York Mets rallied for three runs to record a dramatic 3-2 win.
Rodriquez (4-4) failed to record an out before giving up all three runs.
It was Duda's career-high 17th home run of the season and his third in four games.
"Frankie's done a great job for us all year," Roenicke said. "So, you feel good with Frankie going in there with a two-run lead, and he just didn't get it done today. He wasn't locating his fastball, and these guys are pretty good fastball hitters."
Duda said he was looking for a first-pitch fastball from Rodriguez and got it.
"I was able to put the barrel of the bat on it," he said. "It was a pretty special moment. I am glad I was able to help pick up the team and get this win."
Rodriguez said it was a frustrating performance. The Brewers are now 48-2 when leading after eight innings.
"They come out swinging and everything was up out over the plate," he said. "Fortunately, it's not my first rodeo. Not going to be the first one, won't be the last one. That's the reality."
The loss broke the Brewers' four-game winning streak.
The home run spoiled a sparkling performance by starter Yovani Gallardo, who allowed four hits to New York over 7 2-3 innings.
Gallardo, who hasn't 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 ground ball, but the call was overturned after a replay review.
"He had a good rhythm," Roenicke said of Gallardo. "That was really good to see him throw like that."
Gallardo said he felt good on the mound.
"I think I was able to keep the ball down, both sides of the plate," Gallardo said. "I had a pretty good curveball (and) was able to throw it for strikes."
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, allowing one earned run and three hits, and struck out nine.
Aramais Ramirez grounded to shortstop Rueben Tejada, who got the out at second, but Ramirez beat Murphy's throw to first as 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 returned to New York on Friday because of a sore right elbow. Matsuzaka pitched two innings and gave up three earned runs in the Mets' 9-1 loss to Milwaukee on Thursday. ... Tejada was back in the lineup two days after being hit in the helmet by a pitch thrown by Mariners RHP Taijuan Walker. ... Brewers 2B Scooter Gennett probably will be able to 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) to the mound Saturday night in the third game of the series against the Mets' Jonathon Niese (5-5).