Mehrjui and Mohammadifar were stabbed to death in their home in Karaj, near the capital Tehran, in October.
Three others were jailed for between 8 and 36 years for their roles in planning and assisting the murders, the chief justice of Alborz province said.
Mehrjui, 83, was considered one of the founders of Iranian new wave cinema.
His wife, Mohammadifar, also worked in the world of film as a screenwriter and costumer designer.
The couple’s bodies were discovered by their daughter after she was invited to their house for dinner, Alborz province chief justice Hossein Fazeli-Harikandi said at the time.
In Monday’s ruling, published on the Iranian judiciary’s Mizan website, Mr Fazeli-Harikandi said the four defendants confessed after being arrested days after the murders took place.
Mr Fazeli-Harikandi added that the convicted killer, who was not named, was sentenced to death in accordance with the Islamic law of retribution, following an application from Mehrjui’s family.
The verdicts for all those convicted are not final and may be appealed at the Supreme Court, according to Mizan.
Tributes poured in for the couple after their deaths.
Prominent Iranian actor Reza Kianian was quoted by the Tehran Times as saying: “If there were and are five renowned directors in the history of Iranian cinema, without a doubt, one of them was Dariush Mehrjui.”
Bahram Radan, another prominent actor who starred in one of Mehrjui’s films, The Santur Player, posted a scene from the film alongside a photo of Mehrjui’s family with the caption: “How strange, how heartbreaking, how ruthless, woe to us.”
Mehrjui, who studied in the US as a young man and later lived in France for five years, first rose to national and international prominence with his 1969 film The Cow, which tells the story of a villager’s obsession with the titular animal.
His other notable films include Hamoun, The Pear Tree, and Leila – about an infertile woman who encourages her husband to marry for a second time. https://merujaksore.com/
Mehrjui won many awards and his films were celebrated at international film festivals. But they were also subject to censorship in Iran, with many never seeing the light of day there.