Hi,
Normally you can install directly the 7.X and run the steps 5>6 then 6 >7 as it will be proposed in the install screen.
that being said, I advise you the test it before (module, customisation or bug can block your business)
- by deploying an new Dolibarr 7 and then importing the 5 db ( should launch the migration script)
- by installing the version 5.0.4, update db & doc then deploy the version 7.X
- by duplicating your prod VM (if you work with virtual machine) and test the migration ( I am doing that for my prod server)
both ways are possible i would go with option 1 and use installer to upgrade twice
whatever you do make sure you backup database and then proceed to upgrade