Although a yen is also a type of Japanese currency, that meaning has nothing to do with an overwhelming urge.
Instead, the yen in question is from the Cantonese Chinese yin-yan.
Yin means opium, and yan means craving.
Brought to America in the mid-nineteenth century the word entered English slang as “yen yen” and eventually just “yen,” which early in the twentieth century took the meaning of a craving for anything.