The identity of dark matter has remained surprisingly elusive. While terrestrial experiments may be able to nail down a model, an alternative method is to identify dark matter based on astrophysical or cosmological signatures. A particularly sensitive approach is based on the unique signature of dark matter substructure in galaxy–galaxy strong lensing images. Machine-learning applications have been explored for extracting this signal. Because of the limited availability of high-quality strong lensing images, these approaches have exclusively relied on simulations. Due to the differences with the real instrumental data, machine-learning models trained on simulations are expected to lose accuracy when applied to real data. Here domain adaptation can serve as a crucial bridge between simulations and real data applications. In this work, we demonstrate the power of domain adaptation techniques applied to strong gravitational lensing data with dark matter substructure. We show with simulated data sets representative of Euclid and Hubble Space Telescope observations that domain adaptation can significantly mitigate the losses in the model performance when applied to new domains. Lastly, we find similar results utilizing domain adaptation for the problem of lens finding by adapting models trained on a simulated data set to one composed of real lensed and unlensed galaxies from the Hyper Suprime-Cam. This technique can help domain experts build and apply better machine-learning models for extracting useful information from the strong gravitational lensing data expected from the upcoming surveys.