The 33-year-old, who is now player-manager at boyhood club Anderlecht, suffered the injury in a league game against Genk on August 23 and subsequently missed Belgium’s EURO 2020 qualifying games against San Marino and Scotland as a result.
The former Manchester City captain intends to use proceeds from his charity game to tackle the issue of homelessness in the city of Manchester.
Former Premier League stars including Thierry Henry, Cesc Fabregas, Mario Balotelli and Robin van Persie will all grace the game.
Speaking ahead of the game, Kompany, who struggled with fitness issues in his final years at the Etihad, announced his unavailability for the charity match but promised to make it to David Silva’s next year.
"Unfortunately I won't be starting tonight or playing. It's typical of me, right? I'm usually just there for the end of the season," Kompany said.
"I've got a slight hamstring injury. I couldn't risk it tonight.
"We've got plenty of awesome players to be watching today and in many ways it is about a celebration to say goodbye, it doesn't need to be on the pitch as such.
"In the same way, we are doing it for an unbelievable cause. That takes priority.
"I'll be there for David Silva and Kun Aguero's testimonials."
Kompany led Manchester City to their most successful era, winning four Premier League titles, two FA Cups and four League cups.