Preferred way to control APM2.6 output in mission/manually

Hi,

I’ve been reading and trying a lot these weeks, but it seems all the features and workarounds that are supposed to do this are broken or disabled in current firmware. So I hope someone can help the other way around:

How can I switch an output of the APM-2.6 in two states, 0V/5V, by mission commands and/or by radio?

Purpose is to have a relay switch connected, which I can’t get to work on the documented A9 pin.

Thanks