The following contains spoilers for Secret Invasion Episode 1, "Resurrection," now streaming on Disney+.

Secret Invasion brings Samuel L. Jackson's Nick Fury back to the mainstream Marvel Cinematic Universe for the first time since Spider-Man: Far From Home. He anchors the hotly anticipated adaptation of one of Marvel's most durable storylines, as the shapeshifting Skrull attempt a surreptitious takeover of the planet Earth. The series arrives amid offscreen turmoil for the MCU, and Jackson's return to the franchise promises a stabilizing presence in the next few projects. A solid take on the Skrulls' invasion will do wonders on that front as well.

It could do far worse than look to another long-standing franchise for inspiration. Star Trek embraced a shapeshifting storyline of its own during the Dominion War in Star Trek: Deep Space Nine. The same villains returned for a curtain call in the celebrated third season of Star Trek: Picard. In the process, it struck many of the themes and ideas that would help Secret Invasion shine.

RELATED: What Is Marvel's SABER?

Star Trek's Dominion War Reveals the Federation's Shortcomings

Odo fights another Changeling in Star Trek: Deep Space Nine

Star Trek's Dominion is a totalitarian empire residing in the Gamma Quadrant, on the other side of the stable wormhole that Deep Space 9 essentially guards. The "Founders" who lead the Dominion are all Changeling shapeshifters, capable of assuming any form they wish and impersonating specific people with uncanny accuracy. Paranoid and controlling, they dominate their subjects through terror and genocidal violence. The Founders' abilities allow them to sow discord in potential enemies and bring them down from within.

The showrunners created them to serve as an overarching foe to threaten the whole Alpha Quadrant: forcing the Federation to join forces with traditional enemies like the Romulans in the face of a common threat. Their technology is hundreds of years ahead of Starfleet's, and their fleet -- crewed by fanatical genetically engineered soldiers called the Jem'Hadar -- outnumbers them considerably. But it's the way they hide among their enemies that leaves the most lasting impression. Captain Sisko comes face to face with a dead ringer for his chief engineer in Season 4, Episode 11, "Paradise Lost," who laughs at how much havoc just a tiny handful of them can wreak. Later, in one of the series' biggest twists, Doctor Bashir is revealed to have been impersonated by a Changeling for several episodes. He's restored in Season 5, Episode 15, "By Inferno's Light," but by then a good deal of damage has been done.

The unseen threat reveals cracks and fissures in the formerly formidable Federation. Increasingly authoritarian measures are adopted -- testing the better angels of Starfleet's nature -- and at times ghastly compromises are made in the name of survival. For instance, the groundbreaking Season 6, Episode 19, "In the Pale Moonlight," reveals how Sisko becomes a willing accessory to murder to induce the Romulans into the war. He sells his soul to keep the Federation safe. The Dominion works best as villains when they highlight these flaws while forcing the question of how much can be sacrificed in the name of survival.

RELATED: Secret Invasion Series Premiere Ends With [SPOILER]’s Death

Secret Invasion Can Draw on Deep Space Nine's Example

Nick Fury returns to the MCU in Secret Invasion.

Secret Invasion contains many of the same ingredients that make the Dominion so formidable in Star Trek. The Skrull radicals are far more organized than anyone suspects, ending Season 1, Episode 1, "Resurrection," with Nick Fury seemingly over a barrel. Like the crew on Deep Space Nine, he finds his closest friends possibly compromised. Like the Federation itself, he has to pull together multiple disparate groups -- including Talos' human-friendly Skrulls and MI6 mastermind Sonya Falsworth -- in the face of a superior foe. And like the Dominion, the Skrulls appear to have a technological edge as well as an organizational one. Fury is alone, and his assets are divided. As the episode's shocking end proves, he may have to sacrifice everything to stop his foe, just as Sisko did.

It remains to be seen how well Secret Invasion unfolds its story, and obviously, it has much different narrative needs than Deep Space Nine did. The Star Trek series had years to spin out its story, for starters, while the MCU has just six episodes. But the way Deep Space Nine explored the same dilemma -- fighting an enemy who can imitate anyone -- makes a good roadmap as to how Secret Invasion should proceed. The storylines are similar enough to expect the same potential rewards.

New episodes of Secret Invasion stream every Wednesday on Disney+.