In brain metastasis, cancer cells remain in close contact with the existing vasculature and can use vessels as migratory paths-a process known as vessel co-option. However, the mechanisms regulating this form of migration are poorly understood. Here we use ex vivo brain slices and an organotypic in vitro model for vessel co-option to show that cancer cell invasion along brain vasculature is driven by the difference in stiffness between vessels and the brain parenchyma. Imaging analysis indicated that cells move along the basal surface of vessels by adhering to the basement membrane extracellular matrix. We further show that vessel co-option is enhanced by both the stiffness of brain vasculature, which reinforces focal adhesions through a talin-dependent mechanism, and the softness of the surrounding environment that permits cellular movement. Our work reveals a mechanosensing mechanism that guides cell migration in response to the tissue's intrinsic mechanical heterogeneity, with implications in cancer invasion and metastasis.