Ahmed Manasra, 14, was earlier found guilty of the attempted murder of a 20-year-old and a 12-year-old boy in the Jewish settlement neighbourhood of Pisgat Zeev in annexed east Jerusalem, lawyer Lea Tsemel said.
He was 13 at the time of the attack in October 2015, which was one of the most high-profile in a recent wave of violence.
The Jerusalem district court also ordered Manasra to pay 80,000 shekels (USD 21,000, 19,000 euros) in compensation to the adult victim and 100,000 to the boy.
The attack took place at the beginning of a months-long wave of Palestinian knife, gun and car-ramming attacks.
More From This Section
Footage released by Israeli authorities in the wake of the attack purported to show the cousins - knives in hand - following the Israeli victims.
It also showed Ahmed Manasra in the aftermath of the attack lying bleeding on the ground while Israeli onlookers shouted abuse.
It sparked a propaganda skirmish, with Palestinian president Mahmud Abbas claiming he had been "executed" while Israel scrambled to release video of him sitting up and eating in a Jerusalem hospital bed.