There may be some nuance on this based on your deployment (are there separate tracker names involved for instance?) but very simply, in the case where there is only one other UA account id to deal with you could use the Set Data Values extension (https://community.tealiumiq.com/posts/554049) to set a data source -- let's call it ga_acct_id -- to the appropriate value based on the domain and then map ga_acct_id to the Account (Default Override) destination in your GA tag. If there are multiple domains in play then you would probably want to use the Lookup Table extension (https://community.tealiumiq.com/posts/541621) to set ga_acct_id. For either scenario, you would want to scope the extension to the GA tag.
Hope that helps.