Generic way to include ThirParty zlib.h

I want to include zlib.b header file in my code.
Right now I am on UE5.0 version and I am including as below

#include "ThirdParty/zlib/zlib-1.2.5/Inc/zlib.h"
THIRD_PARTY_INCLUDES_END

But when testing the same code on UE5.1, I am getting compile error as Zlib version has changed.

My question is, is there a generic way to include zlib.h instead of a specific version ?

If you add it as an engine dependency to the zlib module in your build.cs file it should have the relevant include paths set up. So something like:

AddEngineThirdPartyPrivateStaticDependencies(Target, "zlib");

Then in your code you should be able to do:

THIRD_PARTY_INCLUDES_START
#include "zlib.h"
THIRD_PARTY_INCLUDES_END

Thanks David, since we have 3 zlib versions 1.2.12, zlib-1.2.5 & v1.2.8. So my concern is even we provide a specific path for zlib for UE5.1, it might not work for UE 5.0/UE4.27 which uses zlib-1.2.5.
So my question is how the above solution would work for backward compatibility for all the Unreal versions. Please suggest.
Is there any macro defined for specific versions of Unreal Engine, that we can use?