The two men were convicted of shooting dead the four French nationals while they were on a desert excursion from their homes in the capital Riyadh.
Another 12 men convicted of helping the attackers were jailed for periods of between three and 23 years, and banned from travelling abroad for a period equal to their sentence.
The defendants were in court for the verdict in the trial, which began in December 2011, as were relatives of the victims and French consular staff, the source added.
Two of the dead worked for an electrics company, one was a teacher at the French school in Riyadh and the fourth was a teenager.
Police killed the suspected mastermind of the attack, Walid Motlaq al-Raddadi, a 23-year-old Saudi, in Medina in April 2007.
Authorities in the kingdom set up specialized terrorism courts in 2011 to try dozens of Saudis and foreigners accused of belonging to Al-Qaeda or of being involved in a wave of bloody attacks that swept the country from 2003.
The attacks prompted authorities to crack down on the jihadist network founded by Saudi-born Osama bin Laden, who was killed in a US commando operation in May 2011.
The crackdown prompted many of the network’s Saudi militants to shift base to neighboring Yemen.