"The story has not ended yet," the White Knights said on their social media accounts, posting a video of Gaber picking the last Zamalek kit he wore before departing in the summer of 2016.
Zamalek did not reveal further details about the deal. Gaber is the second player to join the club from Pyramids following midfielder Nabil Emad, famously known as Dunga.
"Back to where I belong," the 30-year-old, who took part in Egypt's 3-0 friendly victory over Niger earlier on Friday, wrote on Instagram.
Gaber came through Zamalek's youth ranks, making his first-team debut in 2010. He joined Swiss side Basel in 2016 and had a brief loan stint with Los Angeles FC before joining Pyramids in the summer of 2018.
He made 139 appearances with Pyramids, scoring three goals and providing six assists.
Egyptian champions Zamalek are bolstering their squad in the close season as they seek to defend the Premier League title, which they won the past two seasons.
They also signed Senegalese forward Ibrahima Ndiaye, Moroccan midfielder Zakaria El Wardi, Egyptian defender Mostafa El-Zennari and midfielder Nabil Emad.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)