Source localization and spectral estimation are among the most fundamental problems in statistical and array signal processing. Methods that rely on the orthogonality of the signal and noise subspaces, such as Pisarenko's method, MUSIC, and root-MUSIC, are some of the most widely used algorithms to solve these problems. As a common feature, these methods require both a priori knowledge of the number of sources and an estimate of the noise subspace. Both requirements are complicating factors to the practical implementation of the algorithms and, when not satisfied exactly, can potentially lead to severe errors. In this paper, we propose a new localization criterion based on the algebraic structure of the noise subspace that is described for the first time to the best of our knowledge. Using this criterion and the relationship between the source localization problem and the problem of computing the greatest common divisor (GCD), or more practically approximate GCD, for polynomials, we propose two algorithms, which adaptively learn the number of sources and estimate their locations. Simulation results show a significant improvement over root-MUSIC in challenging scenarios such as closely located sources, both in terms of detection of the number of sources and their localization over a broad and practical range of signal-to-noise ratios. Furthermore, no performance sacrifice in simple scenarios is observed.