If it's not a true sine wave inverter it might run pretty poorly. Pumps generally run pretty rubbish without a nice sine wave. I've tried running canister filters on a non sine wave UPS, they rattled horribly and had barely any flow.
What size battery do you have? Most are in the region of 70 or so amp hours, You don't want to discharge it more than 10% if doing it frequently, or you'll start to kill the battery. But for a one off 50% is probably ok. So 35 amp hours gives you 420 watt hours.
You should be ok for about 8 hours.
Worth trying and seeing how the pump runs beforehand. Otherwise, for such a short time I probably wouldn't worry about it, if you have a canister filter I'd unplug it and give it a quick clean afterwards. Unless you have a small, overstocked tank(you didn't give any details) your fish should be fine.