@VJ , I don't have much expertise with Mellanox drivers but did some research on this issue and here are my findings,
- Here is the list of MLNX_OFED versions intended for Microsoft Azure Linux servers. Not sure if this page needs an update or listed versions are only supported for now. I see there is no support for 5.X here,

Ref: https://www.mellanox.com/support/firmware/microsoft
2.If that is not the case and if NIC's are generalized across all cloud machines, then your ConnectX-4 NIC should support this version according to this release notes.

I would recommend you check with the Mellanox support team on this issue for driver to version compatibility.
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.