We investigate the axion like particle (ALP)-photon oscillation effect in the high energy $gamma$-ray spectra of PG 1553+113 and PKS 2155-304 measured by Fermi-LAT and H.E.S.S.. The choice of extragalactic background light (EBL) model, which induces the attenuate effect in observed $gamma$-ray spectra, would affect the ALP implication. For the ordinary EBL model that prefers a null hypothesis, we set constraint on the ALP-photon coupling constant at 95% C.L. as $g_{agamma}lesssim 5times 10^{-11} ~rm{GeV}^{-1}$ for the ALP mass $sim 10$ neV. We also consider the CIBER observation of the cosmic infrared radiation, which shows an excess at the wave wavelength of $sim 1~mu$m after the substraction of foregrounds. The high energy gamma-rays from extragalactic sources at high redshifts would suffer from a more significant attenuate effect caused by this excess. In this case, we find that the ALP-photon oscillation would improve the fit to the observed spectra of PKS 2155-304 and PG 1553+113 and find a favored parameter region at 95% C.L..