To upgrade VCF environment to 5.x, please follow the below mentioned steps:
If the environment is on VCF 4.3.x and VCF 4.4.x and NSX federation is configured, upgrade to VCF 4.5 before upgrading to VCF 5.x.
If the environment is on VCF 4.5.x and NSX federation is configured, the environment can be upgraded from SDDC Manager UI. For NSX upgrade paths with NSX Federation configured in a VCF environment, please refer Upgrading your NSX Federation Deployment for more information.