Is there any way to set in Unreal engine a custom MSBuild?

We use Rider, the IDE works with the MSBuild tools from Rider, but Unreal Engine apparently only allows you to select the versions of MSBuild distributed by Microsoft. These require a Visual Studio license, is there any way to set it up to only use Rider and its tools? Or is it mandatory to use Visual Studio with its respective licenses to develop in UE?