Nanomaterials have attracted considerable attention as targeted drug delivery systems due to their ability to transport therapeutic agents directly to specific cells, thereby minimizing side effects and enhancing treatment efficacy. Inefficient delivery of mesalazine (5 \(-\) aminosalicylic acid; 5 \(-\) ASA) to target cells may result in reduced therapeutic outcomes, persistent chronic inflammation, damage to the intestinal mucosa, and an increased risk of systemic side effects. Consequently, the design of targeted drug delivery platforms, such as graphitic carbon nitride (g \(-\) C₃N₄) nanosheets, is crucial to improve therapeutic efficacy while reducing adverse effects. In this study, the interaction between the (5 \(-\) ASA) molecule and the pristine graphitic carbon nitride nanosheets was investigated in both gas and aqueous phases to evaluate the effect of the environment on the electronic properties of the adsorption complexes. All calculations were examined using density functional theory (DFT) at the B3LYP/6-311G**(d,p) level of theory. The adsorption of 5 \(-\) ASA on the g \(-\) C₃N₄ surface is thermodynamically favorable, with adsorption energies of approximately \(-\) 19.68 kcal·mol⁻1 in the gas phase and \(-\) 21.50 kcal·mol⁻1 in the aqueous phase for the most stable configuration, indicating consistent interactions in both environments. Analyses based on the noncovalent index (NCI) and the quantum theory of atoms in molecules (AIM), and the reduced density gradient (RDG) map indicated that van der Waals interactions primarily stabilize the 5 \(-\) ASA@g \(-\) C₃N₄ complex. The weak interactions between 5 \(-\) ASA and the g \(-\) C₃N₄ carrier are crucial for facilitating the release of the drug at the target site. Additionally, analyses of the molecular electrostatic potential (MEP), and natural bond orbitals (NBO) revealed charge transfer from the 5 \(-\) ASA molecule to the g \(-\) C₃N₄ nanosheet, providing valuable insights into the electronic communication between the drug and its carrier. Recovery times were calculated to evaluate both the biocompatibility of the system and the efficiency of drug desorption from the carrier. Spectroscopic analyses revealed a red shift of 168 nm in λmax in the gas phase, while a blue shift was observed in aqueous media. These findings demonstrate that g \(-\) C₃N₄ is a promising nanocarrier for the efficient delivery of 5 \(-\) ASA to biological systems, providing valuable insights for the design of advanced nanoscale drug delivery systems.