The big issue behind your question is the relationship between law and morality. That's a very big question, though on at lest one important view of what laws are (legal positivism) the answer to your question is no. On the positivist view, laws are, roughly, what lawmaking entities (legislatures, monarchs...) say they are. Whether a law is is another question, as is the question of whether you should obey some particular law.
Whether you think this is right at the end of the day, it fits the common sense thought that there can be bad laws that are still laws. For example: I'd say that at least some aspects of US civil forfeiture laws are actually unjust. They allow the government to seize your property in ways that, these days, many liberals and conservatives agree are unjust. But critics of those laws don't claim that they aren't actually laws; they argue that the laws should be changed.
In any case, there are laws that don't raise questions of justice. In the USA, the law says you drive on the right side of the road; in South Africa, it's the left. Laws like this aren't unjust, but there isn't really an issue of justice here. Justice isn't the only thing the law concerns itself with.