Cudos on killing that necromancer
good job!
If another one arrives there is a way to ruin his day.
Step 1. Keep any and all corpses locked up where one cannot see them and cannot path to them. I think the necro magic works similar to when you fire a crossbow; in that the necromancer has to have line of sight and a clear shot. Meaning he'll sneak into position and necro your refuse stockpile from a safe distance. Just like gobbos might sometimes snipe into your fortress.
Step 2. Assuming that the necromancer has to see the corpse to raise it, you could construct a passage that leads a system of corners with a corpse storage in the end. Since the necromancer has to navigate the passage before coming within range of the corpse you can fill this passage with all the traps you want. (I hope they don't have trap_avoid)
Step 3. I'm not sure if a necromancer can use his magic from inside of a cage but just in case you do. Don't keep your prisoner storage next to your corpse storage or you might be in for a nasty surprise when using cagetraps.
Step 4. Keep in mind that necromancers don't always come alone. At one point three of them came to one of my fortresses and I can only assume that the number can go much higher than that. You might want to have numerous cagetraps in the passage.
Since cagetraps can only be used once before reloading, I start to wonder wether or not it would be a good idea to just put weapon traps in there.. it's probably a bad idea though since necromancers might be able to raise eachother. Who knows, maybe the resurrected necromancer can raise the dead as well as the living one?
What if his severed, reanimated arm can do it as well?
Beware.