Jani's split with the Dragon team after one terrible weekend in Hong Kong was announced earlier this week, leaving the American outfit in need of a new driver for the Marrakech round next weekend.
That has given Lopez the chance to return to FE sooner than he had expected after being dropped by DS Virgin Racing in the summer.
Dragon is last in the championship and was the only team to fail to score points in either Hong Kong race.
Da Costa secures late win at Monaco E-Prix
"This is an exciting opportunity for me and I'm looking forward to the challenge of Formula E in season four with Dragon," said Lopez.
"I have good experience from season three, and I'm confident that we can achieve strong results as the season progresses."
Lopez scored two podiums with DS Virgin, earning a best result of second in Paris.
In addition to his surprise FE chance in 2018, Lopez is expected to remain part of Toyota's LMP1 programme for the World Endurance Championship's 2018/19 superseason.
There is no repeat of the WEC/FE clashes that hurt Lopez's 2016/17 FE campaign, which means he should be free to contest the entirety of both championships.
Da Costa pips Evans on last lap to win Monaco E-Prix
Da Costa takes Monaco E-Prix pole position