Gallic acid (GA) is a well-known polyphenol that occurs naturally in plants and is used as a chemical marker or standard antioxidant in analytical research. Here, a carbon paste electrode was modified with a nanocomposite of graphitic carbon nitride and gold nanoparticles (g-C3N4/AuNPs/CPE). The g-C3N4/AuNPs was characterized by Fourier transform infrared spectroscopy, X-ray diffraction, energy-dispersive X-ray spectroscopy, and scanning electron microscopy. Electrochemical impedance spectroscopy, cyclic voltammetry, and differential pulse voltammetry methods were used to investigate the electrochemical behavior of GA on the electrode. EIS analysis exhibited lower charge-transfer resistance in g-C3N4/AuNPs/CPE than CPE; 250 vs. 1500 Ω, respectively. The g-C3N4/AuNPs/CPE was used to GA sensing with limit of detection and linear response range of 0.025 and 0.16–4.10 µM, respectively via DPV. Then, the GA content in Iranian honey samples with different floral origins such as Ziziphus, Barberry, Thyme, Astragalus, Eucalyptus and Coriander was successfully determined. According to result, the fabricated electrochemical sensor could be useful for GA evaluation in food samples.