dose of one's own medicine
Also, taste of one's own medicine. Repayment or retaliation, as in It's time we gave them a dose of their own medicine and simply forget to call them back , or Joe was upset at being left out, but they were just giving him a taste of his own medicine . [Late 1800s]
own medicine, a dose/taste of one's
Repayment in kind; tit for tat. Although the idea is hardly new, the medicinal metaphor dates only from the late nineteenth century. V. Perdue used it in The Singing Clock (1941): “It was only fair for them to get a taste of their own medicine.”