Former Canadian prison official Robert Fletcher insisted he had bought the painting - signed Peter Doige - 40 years ago from the artist.
He sued Mr Doig when the latter's disavowal of the work caused its value to plummet.
But the judge ruled that it was a case of mistaken identity after Peter Doige's sister gave evidence.
Imprecise school and prison records from the 1970s had made the claims difficult to resolve.
The case is unusual because disputes over the authenticity of a work of art normally arise long after an artist has died. When artists are alive, it is widely accepted that their word on whether a work is theirs or not is final.
Mr Fletcher claimed Mr Doig had renounced the work to avoid admitting he had spent time in prison.
He said he had bought the painting from Mr Doig for $100 in 1976 when the artist was serving a sentence for LSD possession at Thunder Bay Correctional Centre in Ontario, where Mr Fletcher was working.
But Mr Doig insisted he had never been jailed and had actually been attending high school in Toronto at the time.
He also said that he was not using the kind of canvas the picture is painted on at that point in his career.
The case was resolved after the judge heard from a Canadian woman, Marilyn Doige Bovard, who said the painting was in fact the work of her late brother Peter Doige.
Scottish-born Mr Doig's works are known for presenting ethereal scenes, often with subjects appearing as ghostly figures in forests or by lakes.
His painting of someone slumped in a canoe, entitled "Swamped", sold last year at Christie's for $25.9m.
A Chicago court has ruled that British artist Peter Doig did not paint a landscape once valued at $10m (£7.6m).