Fetching details from the dictionary...

to parody; to make a parody of; to pun (on)
to twist; to distort
歌の歌詞をもじった替え歌を作った。
I made a parody song by twisting the original lyrics.
古典の台詞をもじって笑いを取った。
I got laughs by twisting a line from a classic.
昔話をもじった現代版の物語を読んだ。
I read a modern version of a story parodying an old tale.