Skin infections are frequently treated via intravenous or oral administration of antibiotics, which can lead to serious adverse effects and may sometimes contribute to the proliferation of resistant bacterial strains. Skin represents a convenient pathway for delivering therapeutic compounds, ensured by the high number of blood vessels and amount of lymphatic fluids in the cutaneous tissues, which are systematically connected to the rest of the body. This study provides a novel, straightforward method to obtain nafcillin-loaded photocrosslinkable nanocomposite hydrogels and demonstrates their performance as drug carriers and antimicrobial efficacy against Gram-positive bacteria. The novel formulations obtained, based on polyvinylpyrrolidone, tri(ethylene glycol) divinyl ether crosslinker, hydrophilic bentonite nanoclay, and/or two types of photoactive (TiO2and ZnO) nanofillers, were characterized using various analytical methods (transmission electron microscopy (TEM), scanning electron microscopy–energy-dispersive X-ray analysis (SEM-EDX), mechanical tests (tension, compression, and shear), ultraviolet-visible spectroscopy (UV-Vis), swelling investigations, and via specific microbiological assays (“agar disc diffusion method” and “time-kill test”). The results reveal that the nanocomposite hydrogel possessed high mechanical resistance, good swelling abilities, and good antimicrobial activity, demonstrating a decrease in the bacteria growth between 3log10and 2log10after one hour of direct contact withS. aureus.