Where a party suing another enjoins a third party to the action, this describes a joinder of action.
This could happen where a tenant sues a landlord for non payment of a deposit which was returned erroneously by the agent to the landlord and not the tenant. The agent is enjoined and must admit guilt and compensate or defend the action -despite the agent no longer holding the deposit.
The agent might later recover the loss vicariously by claiming against the landlord. This is a messy resolution.
The agent holding is responsible for the return of the deposit to the correct party.
If the agent held as stakeholder he could refuse to return the deposit to either party until the landlord and tenant agree or failing this a court settles the matter.