Hello Jack,
When you sync on prem Identities to AAD or while installing Azure AAD connect, you will get an option to choose the attribute on-prem to be synced as UPN.
Azure AD uses upn of the user object as the username.
So in your case since the UPN and email of the user object is different, below mentioned are the two scenarios which can be implemented.
If the user has email as - email@contoso.com
and upn as - upn@contoso2.com
and let's say you want the users to login with email@contoso.com.
While installing azure AAD connect select email to be synced as upn and the users will be able to use the email to sign in to O365, provided you have added and verified contoso.com in your tenant.
Regards,
Rishabh