If the key is genuine and not used on another PC (or the old PC is dead), it will usually work. Microsoft calls this a "free upgrade" loophole for accessibility.
Windows will automatically contact Microsoft servers, recognize your motherboard's hardware ID, and activate itself. how to activate my windows 10 pro without product key