Going off this README:
Graylog 5 needs at least MongoDB 5.0. Our recommended upgrade path is to first bring your MongoDB to 5.0 and then perform the Graylog upgrade. Hint: Graylog 4.3.x does support MongoDB 5.0, which allows for a seamless upgrade path.
For what it’s worth, I’m running MongoDB 5 with Graylog 4.3 currently.
> db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
{ "featureCompatibilityVersion" : { "version" : "5.0" }, "ok" : 1 }