AFAIK, no you do not. If you purchased an upgrade version of 5, it either (a) detects the prior version and only asks for the license code for the new version, or (b) if it cannot detect the earlier version, you will need to enter the license codes for both 4 as well as for 5.
I did it like this and it asked me for the licensecode for 4(!!!) during the initial stage of the installation. Then when it installs it asks for the v5 licensecode.