A pitched battle of wills between Italy’s leading nativist politician and the German captain of a migrant-rescue ship has divided European Union governments and highlighted the unresolved problem of Mediterranean migration.

Carola Rackete, the 31-year-old skipper of the rescue ship Sea-Watch 3, defied authorities and forced her way into an Italian port over the weekend in a vessel carrying 40 African migrants rescued near the Libyan coast about two weeks ago. Italian authorities arrested her Saturday and put her under house...