Ukraine moved closer to resolving its monthslong dispute with Russia over natural gas Friday, as mounting economic pain at home—and pressure from Europe—increasingly force the pro-Western government in Kiev into compromising with Moscow. The outlines of the potential deal, reached in Berlin, show how the Kremlin is shifting from a military to an economic strategy to fight Ukraine’s efforts to align itself with the West.