A local-global principle for divisibility of points