Perera set a lap of 1m21.370s in his SSR Performance Lamborghini Huracan GT3 on the DTM's first visit to Oschersleben since 2015, beating Aitken's Emil Frey Racing Ferrari 296 GT3 to pole by just 0.018s in a closely-contested qualifying.
Lamborghini drivers held the top spot for much of the 20-minute qualifying, with Alessio Deledda setting the early pace in his Grasser Racing example with a time of 1m22.818s.
Aitken ended Lamborghini's reign briefly when he went to the top with a 1m21.745s flyer with six minutes remaining, but Perera put the Italian marque back ahead almost immediately afterwards with a 1m21.601s despite running wide at the final corner.
Perera, who qualified fourth on his sole previous DTM outing in a cameo at the Norisring last year, then found yet more time in the closing minutes of the session to nail pole with a final effort of 1m21.370s.
One-time Formula 1 race starter Aitken improved to 1m21.388s in the final minutes of the session to qualify a strong second on his and Emil Frey's first outing, outpacing Perera's team-mate and fellow Lambo factory driver Mirko Bortolotti by 0.038s.
Interview: The rising sportscar star to watch in DTM 2023
Debutant Mick Wishofer made it three cars from Lamborghini's stable inside the top four, the Grasser Racing driver qualifying fourth and just over a tenth of a second slower than Perera.
Fifth place in qualifying went to the Abt Sportsline Audi of works driver Ricardo Feller, with Porsche ace Thomas Preining ending up sixth in the Manthey EMA Porsche with an identical time to the Swiss.
Two-time DTM Trophy champion Tim Heinemann qualified seventh on his step up to DTM with Porsche outfit Tosksport WRT, beating the Schubert BMW of three-time champion Rene Rast.
Jack Aitken, Emil Frey Racing Ferrari Ferrari 296 GT3
Photo by: Alexander Trienitz
Rast, competing in BMW colours for the first time in the DTM after his switch from Audi, set a best time of 1m21.577s to qualify eighth overall and first among the BMW contingent.
His team-mate and reigning champion Sheldon van der Linde qualified a frustrating 19th after setting the pace in Friday practice, while Marco Wittmann was even further behind in 21st in his BMW entered by series newcomer Project 1.
Behind Rast, Laurin Henrich was ninth-fastest in the Team Bernhard Porsche, while Kelvin van der Linde completed the top 10 for Abt Sportsline Audi.
Mercedes endured a woeful qualifying session at Oschersleben, with Winward driver David Schumacher the best of the six-strong AMG contingent in 16th position, albeit with a time that was less than half a second off pole position.
Lucas Auer, returning to racing this weekend following a fracture in Daytona 24 Hours in January, could only set a time good enough for 18th in the sister Winward AMG GT3.