Near-infrared (NIR) probes are highly sought after as fluorescent tags for multicolor cellular and in vivo imaging. Here we develop small NIR fluorescent nanobodies, termed NIR-FbLAG16 and NIR-FbLAG30, enabling background-free visualization of various GFP-derived probes and biosensors. We also design a red-shifted variant, NIR-Fb(718), to simultaneously target several antigens within the NIR spectral range. Leveraging the antigen-stabilizing property of the developed NIR-Fbs, we then create two modular systems for precise control of gene expression in GFP-labeled cells. Applying the NIR-Fbs in vivo, we target cells expressing GFP and the calcium biosensor GCaMP6 in the somatosensory cortex of transgenic mice. Simultaneously tracking calcium activity and the reference signal from NIR-FbLAGs bound to GCaMP6 enables ratiometric deep-brain in vivo imaging. Altogether, NIR-FbLAGs present a promising approach for imaging and manipulating various processes in live cells and behaving animals expressing GFP-based probes.