Windows Server 2019 was the latest version to support MongoDB v5.0. Windows Server 2022 minimum supported MongoDB version is 6.0.
MongoDB Server 5.0 is also End of Life upgrade to v6.0 but I’d recommend then further upgrading to 7.0 and 8.0
ref:
https://www.mongodb.com/docs/v5.0/installation/#supported-platforms
https://www.mongodb.com/legal/support-policy/lifecycles