We demonstrate selective pump focusing for highly isolated single-mode lasers in microdisk and microring cavities, and achieve lasing action from a microdisk cavity underneath a scattering medium. The spatial profile of the pumping light evolves by an iterative feedback process and is optimized to maximize the field overlap with a selected cavity mode. The high order of mode selectivity and high resolving power are obtained in a multimode cavity in the presence of significant modal overlaps. As a result of the adaptive optical pumping, we successfully achieve the efficient energy transfer to a microdisk underneath a random scattering medium and observe lasing action through the scattering medium. We believe that our selective pumping procedure will pave the way for the development of low-threshold, single-mode nanolasers embedded in various materials.