In a move that further sours regional ties as Europe wrestles with its biggest migration crisis since World War II, Hungary, the Czech Republic, Romania and Slovakia all voted against the plan while Finland abstained.
Slovakia's Prime Minister Robert Fico insisted he would not accept the "diktat" from Brussels, under which EU countries must take a share of new arrivals from overstretched frontline states like Greece and Italy.
Interior ministers briskly voted through the deal on the eve of a crisis summit of EU leaders, but in a rare step, it was by a majority vote instead of unanimity.
"We will show that we can do this, and at the same time have rules. That is taking responsibility, that is solidarity," he said on a visit to London.
Luxembourg minister Jean Asselborn, whose country holds the rotating presidency of the EU, said the plan was forced through despite opposition because it was an "emergency situation".
"If we had not done this, Europe would have been even more divided," he told a press conference.