welcome to the forum. and… straight to topic…
both of those gpus should handle all features of current ue5. they both have raytracing capabilities and are latest or semi latest gen. you shouldn’t have any issues, beyond maybe driver compatibility related things that may pop up. should be just fine.