Grant Gustin as Barry
Marlize (Kim Engelbrecht) helps Barry (Grant Gustin) and his team defeat DeVoe (Neil Sandilands) in the Season 4 finale of CW’s “The Flash.” The CW

Barry uses a Thinking Cap to try to defeat DeVoe in the Season 4 finale of “The Flash.”

According to the synopsis for Season 4, episode 23 of the CW series, Barry (Grant Gustin) and his team get help from a surprising ally in the battle against DeVoe (Neil Sandilands). As revealed in a promo photo for the hour, that surprising ally is none other than DeVoe’s wife, Marlize (Kim Engelbrecht).

In the trailer for the season ender, Marlize, aka the Mechanic, seems to have helped Team Flash to get Barry into DeVoe’s mind using a Thinking Cap.

“There’s gotta be another way. [Why not] get my consciousness inside DeVoe?” Barry says of how they can possibly stop The Enlightenment, The Thinker’s ultimate plan of removing the intelligence of everyone on Earth.

It appears, however, that Barry’s decision to get into DeVoe’s mind isn’t a good idea. “You’re in my mind now. There is no escape,” DeVoe tells Barry.

In an interview with Digital Journal earlier this month, Sandilands said that the season finale is “super awesome” and that “fans will be in for a ride.”

Without giving away any spoilers, executive producer Todd Helbing also teased to Entertainment Weekly that the final showdown between Team Flash and The Thinker is something that viewers won’t expect. “It’s an ‘Inception’-inspired episode,” Helbing said of the season finale while name-dropping Nolan’s 2010 Oscar-winning film, starring Leonardo DiCaprio in the lead role.

“Barry doesn’t have to carry the burden of this challenge on his own. It’s really a group effort,” Helbing told TVLine of how DeVoe’s The Enlightenment will be thwarted. The exec producer went on to say that the team’s plan to defeat The Thinker is “totally different” from anything viewers have seen before in a season finale.

The season ender will also feature two major cliffhangers. According to Helbing, one of the cliffhangers will reveal the identity of Jessica Parker Kennedy’s mysterious character, and the other will introduce the main villain for Season 5. Though Helbing didn’t drop any hints about the identity of the next main villain, he said that “most people that are familiar with the comics will probably be able to deduce who the big bad is.”

“The Flash” Season 4 finale, titled “We Are the Flash,” airs on Tuesday, May 22 at 8 p.m. EDT on The CW.