No, it doesn't look at their account (or even if they have an account). It just generates a game code and emails it to the address you specify. Anyone can redeem the code, so make sure you get the address right.
If they don't want the game, I believe you can cancel the purchase. It will also be cancelled automatically if they don't redeem it within 30 days. Here's a support article explaining things.
i7 5820K @ 4.25GHz | RTX 3080 Ti FTW3 | Gigabyte GA-X99-UD4 | Corsair DDR4 3000 32GB | Corsair HX 750W
SSDs: Intel 660p M.2 2TB, 3x Samsung Evo 1TB | Startech PCIe 4x USB 3.0 | Startech PCIe 2x USB C 3.1 gen2