We carry out a re-analysis of the photometric data in R c I c bands which was taken under the Nainital Microlensing Survey during 1998 to 2002 with the aim to detect gravitational microlensing events in the direction of M31. Here, we do photometric analysis of a faint W UMa binary CSS J004259.3 + 410629 identified in the target field. The orbital period of this star is found to be 0.266402±0.000018 day. The photometric mass ratio, q, is found to be 0.28 ± 0.01. The photometric light curves are investigated using the Wilson-Devinney (WD) code and absolute parameters are determined using empirical relations which provide masses and radii of the binary as M 1 = 1.19 ± 0.09M ⊙ , M 2 = 0.33 ± 0.02M ⊙ and R 1 = 1.02 ± 0.04R ⊙ , R 2 = 0.58 ± 0.08R ⊙ based on the R c band data. Almost similar values are found by analysing I c band data. From the photometric light curve examination, the star is understood to be a low mass-ratio overcontact binary of A-subtype with a high fill-out factor of about 47%. The binary system is found to be located approximately at a distance of 2.64 ± 0.03 kpc having a separation of 2.01 ± 0.05 R ⊙ between the two components.