Looking to bounce back from Sunday's shock defeat to Werder Bremen, Bayern dominated the first half, but could not find a way through as Union goalkeeper Frederik Ronnow denied Dayot Upamecano, Kingsley Coman and Jamal Musiala, while Leroy Sane fired wide when well placed shortly before half-time.
The hosts finally broke the deadlock 30 seconds into the second half, as Gueirrero stabbed a shot into the top corner after Harry Kane's effort came back off the post. Kane then thought he'd made it 2-0, but had his effort ruled out after Sane was offside in the build-up.
Union did eventually go in pursuit of an equaliser, but one Manuel Neuer save apart, Bayern were barely troubled and were able to see out what was their game in hand on Bundesliga leaders Bayer Leverkusen to close the gap at the top to four points.