There’s a good likelihood that it will work, but the OS require reactivating. If it does, you may have success with telephone activation, rather than needing to buy a new licence.
Is the point of this that you want to keep certain programs that you have on the Windows 7 device in order to transfer them to the newly built machine, rather than having two PCs?
There are also the possibility of having two bootable drives on one device.
Perhaps think about your ideal configuration and then work towards making that possible.
What is you have a Windows 7 program that doesn’t transfer to Windows 11 64-bit? All may be fine, but with PCs, best to take a belt and braces approach.