The version Usul gave you is correct if you just want a creature that raises the dead... But they will still be valid targets for any [OPPOSED_TO_LIFE] creatures(undead or not), including their own(sometimes).
To prevent that make these two interactions(one is a variant of raise):
1. this is the secret
[INTERACTION:INNATE_NECROMANCY]
[I_SOURCE:SECRET]
[IS_NAME:the secrets of life and death]
[IS_SPHERE:DEATH]
[IS_SPHERE:(any other sphere for your creature)]
[IS_SECRET:SUPERNATURAL_LEARNING_POSSIBLE]
(Add next two lines ONLY if you want necro towers)
->[IS_SECRET:MUNDANE_TEACHING_POSSIBLE]
->[IS_SECRET:MUNDANE_RECORDING_POSSIBLE:objects/text/book_instruction.txt:objects/text/secret_death.txt]
[I_TARGET:A:CREATURE]
[IT_LOCATION:CONTEXT_CREATURE]
[IT_REQUIRES:SUPERNATURAL]
[IT_REQUIRES:CAN_LEARN]
[IT_REQUIRES:CAN_SPEAK]
[IT_AFFECTED_CREATURE:(your creature ID Here):(a caste ID from your creature ~or~ ALL)]
[I_EFFECT:ADD_SYNDROME]
[IE_TARGET:A]
[IE_IMMEDIATE]
[IE_ARENA_NAME:Innate Necromancer]
[SYNDROME]
[CE_ADD_TAG:NO_AGING:START:0]
[CE_CAN_DO_INTERACTION:START:0]
[CDI:ADV_NAME:Animate Corpse]
[CDI:INTERACTION:INNATE_RAISE]
[CDI:TARGET:A:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:A:10]
[CDI:VERB:gesture:gestures:NA]
[CDI:TARGET_VERB:shudder and begin to move:shudders and begins to move]
[CDI:WAIT_PERIOD:10]
2.This is the raise interaction
[INTERACTION:INNATE_RAISE]
[I_TARGET:A:CORPSE]
[IT_LOCATION:CONTEXT_ITEM]
[IT_AFFECTED_CLASS:GENERAL_POISON]
[IT_REQUIRES:FIT_FOR_ANIMATION]
[IT_FORBIDDEN:NOT_LIVING]
[IT_MANUAL_INPUT:corpses]
[I_EFFECT:ANIMATE]
[IE_TARGET:A]
[IE_IMMEDIATE]
[IE_ARENA_NAME:Innately Animated corpse]
[SYNDROME]
[CE_FLASH_TILE:TILE:165:3:0:0:FREQUENCY:2000:1000:START:0]
[CE_PHYS_ATT_CHANGE:STRENGTH:300:1000:TOUGHNESS:300:1000:START:0]
[CE_SPEED_CHANGE:SPEED_PERC:60:START:0]
[CE_ADD_TAG:NO_AGING:NOT_LIVING:OPPOSED_TO_LIFE(<-- you can remove this tag to make them less aggressive):EXTRAVISION:NOEXERT:NOPAIN:NOBREATHE:NOSTUN:NONAUSEA:NO_DIZZINESS:NO_FEVERS:NOEMOTION:PARALYZEIMMUNE:NOFEAR:NO_EAT:NO_DRINK:NO_SLEEP:NO_PHYS_ATT_GAIN:NO_PHYS_ATT_RUST:NOTHOUGHT:NO_THOUGHT_CENTER_FOR_MOVEMENT:NO_CONNECTIONS_FOR_MOVEMENT:START:0]
[CE_REMOVE_TAG:HAS_BLOOD:TRANCES:LIKES_FIGHTING:MISCHIEVOUS:START:0]
Note the parts in () are for you to read; they aren't code to copy-paste. Also don't copy the -> marks. Both should go into the Standard interactions RAW or into any custom interactions RAW you have already made.
On your creature you only need to add [SPHERE:DEATH], [SPHERE:(any other sphere you want, must match the second sphere in the first interaction)], and [SUPERNATURAL].
After this in world(and history)-generation all members of your creatures in (any) civilization will learn the first(secret-type) interaction automatically, which will grant the second interaction. To test this in the arena mode, it is like applying the necromancer(or any other) affect to something, in this case it will be called "Innate Necromancy" in the menu.
Also note, during arena mode testing the raised corpses will not change 'factions', but in adventure and fortress mode they will be automatically loyal to those that raised them.
Credit to Meph for the info/research about custom secrets for innate learning. He made his own necromancer civ that way months back(it might have been more than a year actually).