yǐ​qí​rén​zhī​dào​huán​zhì​qí​rén​zhī​shēn

to give someone a taste of their own medicine