Do I need to apply UR5 before I do an in place upgrade to SC)M 2022/UR1?
You can upgrade to Operations Manager 2022 from Operations Manager versions 2019 with any UR.
Can SCOM 2019 agents and/or Gateway server work with SCOM 2022 Management Servers?
Almost, yes. But I suggest you upgrade at the same time.