This work introduces a novel nanocomposite coating with dual-action self-healing corrosion protection activated by the photothermal response of plasmonic titanium nitride nanoparticles (TiN NPs). TiN@mesoporous SiO2 core–shell nanocontainers were developed as reservoirs for benzotriazole (BTA) corrosion inhibitors and incorporated into the shape memory epoxy coating matrix. Under near-infrared (NIR) light irradiation, the thermogenesis effect of TiN could not only promote the release of corrosion inhibitors from nanocontainers into the crevice, but also trigger the shape memory effect of damaged epoxy to merge the coating scratch. As such, the dual-action self-healing mechanisms combining the formation of an inhibitor-based protective layer and the scratch closure efficiently suppressed the corrosion process at the exposed metal surface. Surface characterization and electrochemical measurement results proved that the nanocomposite coating incorporated with 2 wt% of TiN-BTA@SiO2 exhibited the optimal corrosion protection as well as an excellent self-healing performance that can be initiated within 30 s of NIR illumination. This photo-controlled self-healing approach is potentially useful in designing next-generation self-healing coatings with ultrafast response time and high healing efficiency.