You can connect to multiple databases using the wpdb class, see https://developer.wordpress.org/reference/classes/wpdb/.
From there you can do something like this:
$mydb = new wpdb('username','password','database','localhost');
$rows = $mydb->get_results("select field from my_table");
I’m not sure about changing the structure off storing the users to a different database. You may want to copy the users tables to a different database to still make use of the WordPress backend. If you take away the tables then you may need to change all login and registration processes too.