Klien was also a Red Bull affiliated driver during his F1 stint, which also included time at Jaguar and HRT between 2004 and 2020.
The Austrian racer will compete with the JP Motorsport team in a gold-liveried McLaren 720S GT3, but the team will only participate in three rounds, before embarking on a full DTM season in 2022.
Those three events will be Zolder, Nürburgring and Assen, rounds four, five and seven respectively.
“I’m really looking forward to the challenging season that lies ahead,” said Klien. “The DTM races will be the absolute highlight for me this year. There we can compete with the best teams and drivers in GT3 racing and show what we are capable of.
“With McLaren we have found an excellent partner for this and we are very much looking forward to working with this renowned manufacturer.”