Sourcing a Relay for AC Power Loss on UPS
You need a relay with a 120VAC coil (if in US or Canada, 240VAC elsewhere) and low current SPDT contacts.  The relay coil would be connected in parallel with the UPS AC input.