The second-seeded Chilean ended the run of El Aynaoui - the oldest semifinalist on the ATP tour since Jimmy Connors 15 years ago - and extended his clay record to 9-0.
"If someone had told me beforehand that I could reach the semifinals, I would have jumped at it,'' El Aynaoui said.
In Sunday's final, Gonzalez will chase his 10th title when he faces the winner between top-seeded Paul-Henri Mathieu of France and Simone Bolelli of Italy.
El Aynaoui is 36 years old, seven months, while Connors was 40 years, five months when he reached the San Francisco semifinals in 1993. The Moroccan has been a favorite of Munich spectators since he won the 2002 title and stripped off his shoes before hopping into the sports car he won.
El Aynaoui, ranked 295th, had to play three extra matches to qualify for the main field. He broke Gonzalez's serve to lead 3-2 in the second set after claiming the first.
Gonzalez broke his racket in anger and lifted his game afterward to win in just under two hours.
Gonzalez wins at BMW Open; Kohlschreiber out
Nadal through to Barcelona Open quarters
Medina Garrigues reaches Fez quarters