Kompany, who joined Anderlecht in the summer as a player-manager, struggled with injuries near the end of this City career and joked that his absence was "typical" while speaking to reporters.
"Unfortunately I won't be playing tonight. It's typical of me, right? I have a slight hamstring injury so couldn't risk it - there are plenty of awesome players," Kompany said.
The 33-year-old suffered the injury in Anderlecht's 1-0 loss to defending league champions Genk last month.
The testimonial match will take place Wednesday at the Etihad Stadium where Manchester City will honor the Belgian defender, who left the club in June after 11 years of service.
Since the match was announced in May, former teammates including Joe Hart, Craig Bellamy, Mario Balotelli, and Sergio Aguero have signed up to take part in the event.
Those players will go up against a Premier League All-Stars XI side that will feature Manchester United legends Edwin van der Sar, Gary Neville, Paul Scholes, and Ryan Giggs, along with others such as Cesc Fabregas, Thierry Henry, and Robin van Persie.