Think of it like this:
A small, cheap UPS has enough batteries to run maybe a few of these units but only for a few minutes. So if you are running one, you might get half an hour at best. This is fairly useless for your purposes unless your performances are very short. And to get this much run time you have had to install the guts from something the size of several bricks into your case, probably tripling the weight of it.
This would have been the simplest method, since you are merely re-housing some stuff.
Simplest in terms of work at least, but what you are doing there is converting DC from the batteries to AC via the UPS circuitry into the iMac PSU which converts it back into various DC signals for the logic board.
You could opt to bypass the the UPS bit and the iMac PSU, but you would need to know all the pinouts from the PSU. Also you are then short on the power management front. The iMac has no drivers for the battery. Modern laptops have complex power management systems to deal with the battery and its interaction with the rest of the system.
I would say the only way to go would be to use a UPS but choose your own batteries. Or a car battery with an inverter (and a surge protector).