Zakaria has signed a contract at the Allianz Stadium until the summer of 2026.
The 25-year-old joined Monchengladbach from FC Basel in the summer of 2017 and his contract would have expired this summer.
Rather than allow him to leave for free in six months’ time, Monchengladbach have cashed in on Zakaria for €5m.
In a statement on Gladbach's official website, vice president Rainer Bonhof said: "There has been a lot of work put into this transfer in the last few weeks and Denis has had an important role in pushing the move through.
"He made it clear to us that he wanted to change clubs and also let us know that he wanted to give Borussia a transfer fee for the move. This made sense from our end in terms of the financial implications of the deal, so we agreed to the deal.
"We would like to thank Denis for his honesty and openness, as well as for his performances at Borussia over the last four and a half years. We wish him all the best and good luck for his new journey."
Juventus have been busy on transfer deadline day, also allowing Dejan Kulusevski and Rodrigo Bentancur to join Tottenham Hotspurs.