We report the nonenzymatic detection of 5-methylcytosine by using template-directed photoligation through 5-vinyl-2′-deoxyuridine derivatives with high selectivity. In this paper, we propose a new detection method by using hydrophobic interaction. The photoligation yield of the 5-methylcytosine case was approximately 5.6-fold higher than that in the case of cytosine.