Special Judge Pawan Kumar Tripathi gave the ruling after finding them guilty of rape, murder, abduction and criminal conspiracy over the killing of a 20-year-old woman.
The case, the eighth of the several lodged against them, was registered by the Central Bureau of Investigation or CBI on December 29, 2006.
Koli and Pandher were present in the court during the sentencing.
Prosecution lawyer JP Sharma sought the death sentence and argued that forensic evidence proved that Koli abducted, killed and raped the woman and also tampered with evidence.
Koli lured her inside where she was killed and beheaded. Investigators found her skull behind the house.
Defence lawyer Devraj Singh pleaded for minimum punishment as Pandher suffers from high blood pressure and diabetes.
The gruesome cases came to light in 2006 when the police discovered the skulls and bones of 16 persons, mostly children, near Pandher's house in Noida's Nithari village.
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections. Election results will be out on May 23.