El Ghazi was suspended by his club on October 17 after putting out a pro-Palestine statement on his social media handles.
The 28-year-old only joined Mainz as a free agent last month after leaving PSV Eindhoven and has played three times for his new club.
Mainz had a meeting with El Ghazi on Thursday and wanted him to apologise for the post but he instead wished for peace in the ongoing conflict.
The Bundesliga side announced the decision in a brief statement, which read: "1. FSV Mainz 05 terminated their contract with Anwar El Ghazi with immediate effect on Friday.
"The club has take this action in response to comments and posts from the player on social media."
But the Dutch winger remained unrepentant, taking to Instagram to post: "The loss of my livelihood is nothing when compared to the hell being unleashed on the innocent and vulnerable in Gaza."
El Ghazi has previously spent time in the Premier League with Aston Villa and Everton.
He has won two caps for the Netherlands national team.