We report hints for the correlation between the X-ray and \gamma -ray emission in the nearby galaxy NGC 4945 , which harbors both an active galactic nucleus and a nuclear starburst region . We have divided the Fermi /LAT observations of NGC 4945 into two datasets , comprising events detected during the low ( L ) and high ( H ) level of X-ray emission from the active nucleus of this galaxy , determined using the Swift /BAT light curve . Both datasets contain an equal amount of 3.8 years of LAT data and NGC 4945 is detected with a similar statistical significance of \sim 15 \sigma in L and 14 \sigma in H. However , the slope of the \gamma -ray spectrum hardens with the increase of the X-ray flux , with the photon index \Gamma = 2.47 \pm 0.07 in L and 2.11 \pm 0.08 in H. The change is confirmed by a systematic variation of the spectral energy distribution as well as a substantial reversal of the \gamma -ray signal in significance maps for low and high \gamma -ray energies . The X/ \gamma -ray correlation indicates that the \gamma -ray production is dominated by the active nucleus rather than by cosmic rays interacting with the interstellar medium . We discuss possible locations of the \gamma -ray source . We also compare NGC 4945 with other starburst galaxies detected by LAT and we note similarities between those with active nuclei , e.g . unlikely high efficiencies of \gamma -ray production in starburst scenario , which argues for a significant contribution of their active nuclei to the \gamma -ray emission .