This is an adaptation of a folk tale from the Uji shui monogatari.
The story goes, a man who has a rather unbecoming wen on his face goes into the mountains to collect firewood. He takes cover from the storm in a hollow in a tree where he falls asleep. He wakes to the sounds of music, he investigates hoping to find people but instead stumbles upon demons. [sometimes depicted as Oni, here they are Tengu (yamabushi and karasu tengu] He joins in with the dancing much to the demons surprise.
The head demon was amused by his dancing and pleased by his polite disposition and requests that he returns again. As a form of insurance they need something precious of his to ensure his return. The wen on his face is called a fukurami in Japanese, fuku meaning luck (it's a kind of pun) seems a likely choice. The man is smart enough to keep up with their conversation and acts reluctant to part with it.
Now the demons demand it and promptly it's removed. The man's neighbor also has a wen he wants gone so, in the other mans place he goes to the mountain and dances for the demons. He does not show the proper respect and is a generally poor dancer so the demons give him the wen back.