I did some more research on this and apparently the mythology is pre-existing in Buddhism and is pretty well known. Here is a description from a Buddhism mythology web site:
Bishamonten, the god who protects all places where the Buddha preaches, is guardian of the north, and he is accompanied by two classes of demons called Yaksha and Rasetsu. The Beasts of Buddhist Hell are also known in Japan as "Gozu-Mezu" -- short for Gozu Rasetsu 牛頭羅刹 and Mezu Rasetsu 馬頭羅刹. With heads resembling those of ox / cows (Gozu 牛頭) and horses (Mezu 馬頭), they are said to torture and feed upon the flesh of the deceased (those who have committed sins and are thus in hell). The Rasetsu might be particularly monstrous Yaksha, or alternatively, the Yaksha might be Rasetsu who have pledged to serve the Deva as guardians of forests, villages, and towns. The iconography is unclear.
Gozu and Mezu torture people in hell; from Taizong's Hell (1735), a Chinese Buddhist scroll.