Targeted killing multidrug-resistant bacteria with high efficiency is urgently needed for the treatment of infection with minimal collateral damage. Herein, a new near-infrared (NIR) fluorescence nanoprobe is designed and synthesized with aggregation-induced emission (AIE) features, which also is excellent reactive oxygen species (ROS) generator. The as-prepared AIE nanoparticles (NPs) present outstanding sterilizing rate on methicillin-resistant Staphylococcus aureus (MRSA) and kanamycin-resistant Escherichia coli (KREC). Meanwhile, considering the differences in the surface structure of animal cells and bacteria, a non-invasive image-guided strategy for precise treatment of bacterial infection has been successfully implemented based on bioorthogonal reaction which can perform and control unnatural chemical reactions inside living organisms. The AIE NPs are thus specifically trapped on the bacterial surface while not on the normal cells, realizing real-time tracking of the infected site distribution in vivo and guiding photodynamic therapy (PDT) for eliminating bacteria in inflammation region. That significantly improves the accuracy and sterilization rate of bacterial-infected wounds with negligible side effects. The investigation developed a potential antibacterial agent and also provides an instructive way for targeting treatment based on bioorthogonal reaction.