If it let's you buy the expansion on Steam (even without the base game) then you should be fine. However since it's coming up as DLC on Steam, I'm guessing it won't let you as it doesn't think you own the actual game.

Your options are therefore to either get your friend to buy it/pass the key on to you as the above suggested, or purchase FFXIV on Steam yourself (and just don't use the code it gives you/use your existing account) and then purchase Heavensward as well.

Unfortunately the second option would be better longterm (for when they add a second expansion etc), but it is a waste of your money and although you could give the new game code to someone else, they'll be in the same boat you are right now.