iPad mini 5 password

You should be able to reset the Apple Account password with as long as you know the device passphrase. See If you forgot your Apple Account password - Apple Support

Once you know the Apple Account password for for Gmail account, then you can sign out of from Settings / Apple Account and then sign in your dot Mac account.