The mechanisms of origin of ultrahigh-energy gamma radiation are poorly studied. One way to find out is to search for temporal and directional coincidences of high-energy galactic neutrinos with photons of similar energies. The results of such a search could provide indications of the hadronic origin of this radiation. In this paper, we report on the search for photons with energies above 300 TeV in coincidence with high-energy neutrinos. The searches of ultrahigh-energy gammas were carried out at the Carpet-2 EAS array, using three years of data taking.