Shouldn't do, most mains fire alarms don't have a tripwire for a loss of power like that. I presume it's because the battery is supposed to take the weight in the event of a power cut.
Flip the fuse, pop the alarm open (if you can, some of them are closed unit where you need to replace the whole thing) and yank the 9-volt out of there.