In PvP: You can only join battle within a set period of the engagement beginning (1 minute, I believe). After that, it is locked and NO ONE can get in, no matter what you do, how you plee, etc. It cannot be done.
In PvE: If you are on a team with the player you may join unconditionally. If they fire a flare, any player of the same nation can join in (I think).
Additionally, if you are nearby and on a team with someone who is drawn into battle, you are drawn in as well (I don't know the exact range).