The seventh-seeded Davydenko, who won the Munich tournament in 2004, led 6-3, 4-0 when the Czech quit. Davydenko had treatment on his foot in the first set.
Mayer will be seeking his first ATP Tour title and hoping to become the first German to win the BMW Open since Philipp Kohlschreiber in 2007. He is the highest-ranked German player at No. 35 and advanced to his first final of the year.
In his previous three appearances in Munich, Mayer never got past the first round.
"I think I played a nearly perfect match," Mayer said after defeating Petzschner for the third time in three matches.