I have an FSDT GSX2 license installed on P3Dv4 and I will uninstall this version to upgrade to P3Dv5 version, how should I proceed with the installation of GSX2?
Just run the current GSX installer again, and select P3D V4 and P3D V5. Activation is completely irrelevant to the simulator used, it's stored on Windows so, as long you don't reformat Windows, you can uninstall/reinstall any FSDT product an unlimited number of times.
If you would eventually decide to uninstall P3D V4, there's no need to do anything to GSX. The folder is shared between all supported simulators, so you won't reclaim any space if you uninstalled\reinstall GSX on P3D V5 only.
The only significant disk space savings would be if you had the a 32 bit version ( FSX and/or P3D1/2/3 ), and remove it. Uninstalling reinstalling GSX would save you disk space, because the next reinstall on P3D V4/V5 won't install all the Legacy non-PBR objects.