Ex-Sauber and Manor Formula 1 driver Wehrlein announced his split from the team with immediate effect in a social media post the day after the final round of the FE Race at Home Challenge Esports competition.
His rapid exit followed a failure to agree terms with Mahindra to see out the rest of the season at the team.
It is widely expected that Wehrlein, who currently sits 14th in the FE standings after five races, will join Porsche to replace Neel Jani for the 2020-21 season.
Mahindra has now revealed that 2014 GP3 champion Lynn will join the team for the six races at the Tempelhof Airport in Berlin to partner team-mate Jerome D’Ambrosio.
Lynn said: “I am really excited to be able to represent Mahindra Racing in Berlin.
“I have high ambitions in this championship that match what Mahindra Racing wants to achieve. I just can’t wait to get started.
“I’ve raced twice in Berlin before and always felt that I went well there, including appearing in superpole last season.
“The format of Berlin is going to be exciting and challenging at the same time and I’m looking forward to hitting the ground running.”
The 26-year-old Briton made his FE race debut for DS Virgin in the 2016-17 double-headed New York E-Prix and scored a maiden pole position but retired from both races owing to car failure.
Lynn continued at the team full-team for the following campaign and finished 16th in the standings, before signing for Jaguar and ending up 18th in the 2018-19 season.
He was then replaced at the team by long-time Ferrari GTE World Endurance driver James Calado and has been without an FE drive since.
Mahindra CEO and team principal Dilbagh Gill added: “[Alex] has achieved some fantastic highlights in his career already and we’re confident that together we can get results in the remainder of [the 2019-20 season].
“It’s not easy to jump in mid-season, especially with the unique way we will be running the races in Berlin, but Alex has a hunger, talent and experience that we are sure will pay dividends fast.
“We would like to thank Pascal for his contribution and wish him all the best in his future endeavours.”
The current Mahindra M6Electro has been hit by reliability problems so far this season, largely down to a change in gearbox supplier.
D'Ambrosio occupies 16th in the points. as the team ranks 10th of the 12 entries.