Substitutions will always be based off the action User parameter. If it's set to Automatic it will try to find a user object for the auto action and use them. If it doesn't find one it will be of the user who triggered the event. With gj_onBeforeJoinGroup that should be the user who is trying to join the group.
So to send to the user who is trying to join the group just leave To blank or use [user_id] or email as To works with both user ids and email addresses. To send it to the group owner then we'll need to take a look at the available variables in that trigger, which are the following.
Code:
$_PLUGINS->trigger( 'gj_onBeforeJoinGroup', array( &$row, $group, $user ) );
So in this case var1 is the GJ User, var2 is the GJ Group, and var3 is the CB User. So to send to the group owner you should be able to just use [var2_user_id] since the user_id of the group is always its owner.