German Cup semi-final behind closed doors, with both teams supporting the Black Lives Matter movement.
Bayern's early goal by Ivan Perisic was cancelled out by a second-half equaliser from Frankfurt's Danny da Costa, who had only been on for three minutes at the Allianz Arena.
However, Robert Lewandowski settled the matter with the winner 16 minutes from time to claim his 45th goal this season in all competitions.
Bayern will face Bayer Leverkusen, who beat fourth-tier side Saarbruecken 3-0 on Tuesday, in the final at Berlin's Olympic Stadium on July 4.
"We didn't always make the right decisions in the area, we should have been three or four up at half-time, which would've made our lives much easier," admitted Bayern's Thomas Mueller, whose chip set up Perisic's opening goal.