Before Outlook can talk to Gmail, you must explicitly permit it in your Gmail web settings.
Add a Gmail account to Outlook for Windows - Microsoft Support gmail outlook settings
For most modern versions of Outlook (Office 365, 2021, 2019), you can use the automatic setup feature: and go to File > Add Account . Enter your full Gmail address and click Connect . Before Outlook can talk to Gmail, you must
A Google sign-in window will appear. Enter your Gmail password and complete the if prompted. Before Outlook can talk to Gmail