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.
Mainz have informed El Ghazi his contract will be terminated.
He responded with an Instagram stories post, saying: "I condemn the killing of all innocent civilians in Palestine and Israel.
"My sympathies are with the innocent victims of this conflict irrespective of their nationality. I am committed to a peaceful and integrated Middle East region.
"To the extent my previous statements on social media have been misunderstood, I would like to make clear that I stand for peace and humanity for all."
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.