There’s a technique in this post that addresses this use case: What is the best way to connect multiple FreePBX together?
The idea is to encode the external CallerID of the dialing extension in a custom header, and then extract it again on the pstn leg of the call. The linked post uses IAX, but the same could be done with SIP as well.