Basically to prevent a D.E.M. you need to introduce the skill (or person) early, and sustain reference to it (or them) frequently; so they do not fade from the reader's mind as a possibility.
FOR EXAMPLE, If my MC is a 13 yo girl, and needs to knock out an adult male kidnappers at the end of the book, that is so unusual that I need to make her a black belt in self-defense at the beginning of the book, probably in the first 1/8 of the story (when readers are first learning about the characters and world and will accept almost anything; up to and including magic, alternative universes, aliens, etc).
The opposite of the D.E.M. is a joyous rescue, an "Of Course!" moment, or "Finally!" or "Hooray! She made it!".
To have that, you want the reader wondering, not if the TP is capable of saving them, but if the TP is going to get there on time.
I don't know how your story is structured, but one way to do that is to make the TP part of this operation from the start, he was supposed to escape with them but was blocked. He promised to "catch up", but his situation did not seem hopeful. Have the SP and MC wonder where the TP is for the first part of the escape, then later give up hope and assume the TP captured or killed, then later as they are about to join him in that state, HEY, here he comes! Bloody and beaten, but guns blazing! Hooray!
In a sense then I have given the TP his own "hidden" story arc. We only see the beginning (him being captured), our focus characters speculate on the middle (wrongly by thinking him defeated), but then we see the end (his triumphant return) that proves the middle was a harrowing experience for him.
Now you can continue that arc and have the TP leave after saving them, on his own mission separate from them, or you can end the arc and have him join the MC and SP to help them to safety (presuming they are still being chased).
It is not a D.E.M. if the reader has been prepped to believe this is something that can happen. If you don't prep them, then the surprise of the help appearing is what breaks their belief.
Now you DO want there to be an element of surprise or suspense, not that the TP was capable of saving them, you want that to be plausible from the beginning. The surprise should be that the reader is led to believe the TP must be dead or imprisoned, and then somehow survived and managed to escape himself, to get there on time to save them.