The Brewers moved to 7-2 on their 10-game road trip with their latest come-from-behind victory.
Rookie Jake Cave hit a two-run homer in his major league debut for the Twins to give them a 4-2 lead in the fourth, but the Brewers battled back with two runs in the fifth inning and Yelich's go-ahead home run off Addison Reed (0-3).
Brewers closer Josh Hader (2-0) got the final out in the seventh, struck out the side in a 1-2-3 bottom of the eighth and struck out three more in the ninth after a leadoff walk.
Both rookie starting pitchers struggled with their control.
Milwaukee's Freddy Peralta, who struck out 13 in his outstanding first start, allowed four runs in four-plus innings while walking six.
Minnesota's Fernando Romero, who allowed just one run combined in his first three starts, lasted five innings, allowing four runs (three earned.) He threw two wild pitches, both of which were costly.
Romero's wild pitch to Jesus Aguilar with two outs in the fifth inning brought home Manny Pina to tie the game at 4 after Pina's RBI double pulled the Brewers within one. Romero also uncorked a wild pitch with a man on first base in the first inning. With Lorenzo Cain trying to advance to second base, catcher Bobby Wilson committed a throwing error that allowed Cain to scamper to third and later score on Aguilar's sacrifice fly for the game's first run.
Aguilar hit his third home run in two games, tying the game 2-2 leading off the fourth inning.
The Twins had taken a 2-1 lead on Wilson's two-out, two-run double in the bottom of the second. It was Wilson's fourth hit with the Twins — three of which have driven in runs.