For the practical usage of the photon-counting detector (PCD) in medical imaging, conductor material stability, photon counting efficiency, and energy separation accuracy must reach a certain level. Besides the pulse pile-up phenomenon, PCD has a non-linear response of the incident X-ray energies, and thus without proper energy calibration, the reconstructed images produce significant ring artifacts. In this study, we propose a water gain correction method for energy calibration of the PCD. To calculate the gain of each detector pixel, we measured the ratio of the sinogram between a water cylinder phantom and an ideal water cylinder phantom, and then averaged the ratio over all views. Then, this gain was multiplied to the projection data acquired from the traditional flat field correction method. The performance of the proposed method was compared to flat field correction methods that use averaged air shots and scan data of a water cylinder phantom. Our results show that the proposed method reduces the ring artifacts effectively without increasing the noise in the final image. It is also observed that the proposed method provides improved SNR and CNR by 45 to 55% compared to the flat field correction using scan data of a water cylinder phantom.