Provided are: a five-membered ring compound represented by formula (1) or a pharmaceutically acceptable salt thereof and a medicine containing the compound or salt. The compound or salt inhibits the infiltration of leukocytes such as eosinophils and lymphocytes, is effective as a therapeutic agent for various kinds of inflammation, and is so safe that the compound or salt can be taken for long. In formula (1), R 1 is (substituted) phenyl or pyridyl; R 2 is (substituted) pyrazinediyl, pyrimidinediyl, or pyridazinediyl; R 3 to R 5 each is alkyl (provided that -N(R 4 )R 5 may be morpholino); and Y 2 is alkylene.