Cubase seems to recognise plugins purely on the name of the dll so if the name is different (Kontakt 4.dll, Kontakt 5.dll) the plug is seen as a completely different plug and there is currently no way to assign it as such.
If you re-select the new plug inside of the project you lose all settings of the old one which is not what you want when trying to recover a track.
There is a somewhat inelegant hack that should work for most plugs (at least in Windows and vst2 plugs…you haven’t listed your o/s so I don’t know if this applies to you)
All you do is make a copy of the new plugin dll file in your vstplugins folder and rename it to the old version. With Kontakt bear in mind there are multiple dlls so either copy them all or work out which version exactly is in the projects.
No promises that this will work with every plugin or that some incompatibility between versions won’t crash it but for the most part it seems to work. I’ve never tried it with vst3 plugs…but if there is no vst3 version of the copied dll Cubase should use the vst2 anyhow.