Marlon Byrd had tied the game in the eighth with a two-run homer, but Jake Diekman (2-2) undid that in the last of the ninth.
He let Marcell Ozuna reach with a one-out single and then Jeff Mathis kept the inning alive with a two- out base hit. Pinch-hitter Reed Johnson's infield hit loaded the bases, before Yelich lined a ball through the left side of second base to score Ozuna and end the game.
Steve Cishek (4-1) fanned two in a scoreless top of the ninth.
Celebrity Couples of 2014 [PHOTOS]