Does return path need a diode?
If it's all DC as you have drawn it, then you can simply tie the negative cable from the ups battery to the main battery.

If you are using AC, then please ignore, and do not connect them.