I assume that the gateway has multiple ports (trunks). If so, they can generally be set-up in one of two ways, as a group, or as individual trunks coming into 3CX. It is easier to configure if each trunk is set-up individually, each is a separate trunk group registered as IPofgateway: Port.
This way one trunk is port 5060, the next 5061, etc., all addressable at the same local IP of the gateway box.
Once this is done, you have to decide how the incoming calls, from one trunk, are to be routed back out on the second. For this you will have to have the calls first go to an extension. This can be a dummy extension (no physical set attached). the call forwarding rules of that extension will be used to direct calls back out on the second trunk. Outbound rules may have to be created to allow the routing.
If the destination number is required to vary, then a digital receptionist could be inserted first, with selections sent off to multiple extensions, each with a different forwarding number.