By using a custom database connection you can use Auth0 to perform user authentication while still doing the actual user credential validation against your existing database. This would allow the user to login both to Site A and Site B with the same credentials and since Site B is Wordpress you could consider using the Auth0 Wordpress plugin to enable this authentication integration.
However, have in mind that the previous just enables reuse of user credentials on both sites; the users would still login independently to both them with just the added benefit that they would be using the same credentials. If you want to then enable SSO across Site A and Site B you would have to ensure that both sites perform authentication through Auth0 so that a common authentication session is established at Auth0 which would then open the possibility of SSO. This would imply that you would have to update Site A to also use Auth0 for authentication through the custom database connection you would implement; this update would be transparent for end-users as credentials would be maintained, but Site A login implementation would have to be changed.
In addition, have in mind that automatic login to Wordpress can be configured when your users use a single connection to authenticate; this seems to be your case as all users would go through the custom database connection.