Japan's constitution defines marriage as one between "both sexes".
But a Sapporo court ruled that this denied the couples constitutionally-guaranteed equality, in what is seen as a symbolic victory for LGBTQ activists.
Japan is the only country in the G7 group of developed nations that does not allow same-sex marriage.
The case was one of several brought to district courts in various parts of Japan by a group of same-sex couples who are seeking damages for mental suffering.
The Sapporo court rejected the compensation claim of one million yen ($9,000; £6,480) per person for being denied the same rights as heterosexual couples.
But it found that not allowing them to marry was unconstitutional.
Ai Nakajima, who is among the group of plaintiffs, told the BBC: "This is one huge step forward in Japan... We are moving closer to making our dream come true."