Another option, depending on player/schedule availability, is to arrange some solo play for the captured player in order to try to escape. Some builds will certainly The method of escape could tie in with the diety of the cleric. A nature priest could be visited by a mouse, rat, or other small animal who retrieves the key. A cleric of the god or goddess of knowledge may have the location of a weakened cell bar revealed in a dream. A combat-oriented cleric could simply get an opportunity to try and overpower their guard.
You could go for even more suited towards escaping than othersblatant acts of "divine intervention", but escape options can range from overpowering guardsshould it fit your campaign. The player's diety could grant them a one-time spell that could bypass whatever magical restraints might be in place, or a minor extra-planar minion could be sent to improvising waysfree the cleric and then leave. If the party was defeated previously by the necromancer while at full strength, some divine assistance may very well be called for, as attempting to openbeat the same necromancer while short a cell door fromplayer, now that the insidenecromancer is alert and expecting them, to convincing other NPC prisoners to work together to escapewill likely be even more difficult.
Once the player escapes, there can be additional solo play while the captured PC retrieves their equipment, and perhaps incidentally finding more information about the final villain that could provide what sounds like a much-needed advantage in the final battle (e.g. as the party begins to engage the necromancer, the missing PC bursts into the room shouting "watch out! There's a hidden pitfall filled with undead minions right in front of the altar!").
This keeps the captured PC from feeling like he's being punished by missing game-time due to being captured (a situation that may or may not be his fault), while building the feeling of heroic storyline.