Keitany became the first woman to win three straight titles since Grete Waitz won five straight from 1982 to 1986. She pulled away around the 15th mile and finished with an unofficial time of 2 hours, 24 minutes, 26 seconds -- one second behind her time last year.
Ghebreslassie finished his debut in New York with a time of 2:07:51.
For most of the course, the men's field was a three-man race between Ghebreslassie, Kenya's Lucas Rotich and Ethiopia's Lelisa Desisa. By Mile 20, Ghebreslassie began gradually pulling away.
The 20-year-old beat Rotich by 62 seconds to become the youngest male winner in New York. The previous youngest male winners were Alberto Salazar in 1980 and Tom Fleming in 1973, who won as 22-year-olds.
Defending champion Stanley Biwott of Kenya withdrew at the 10-mile mark with a right calf injury. He also dropped out in the Rio Olympics after getting sick.
American Abdi Abdirahman placed third.
Desisa, who was the runner-up in New York in 2014 and a two-time Boston Marathon winner, dropped out at the 22nd mile.
Tatyana McFadden won the women's wheelchair race to sweep the four major marathons for the fourth straight year.
The 27-year-old American finished with an unofficial time of 1:47:43. She completed the Grand Slam by winning in London, Boston, Chicago and New York, extending her record streak to 17 straight wins in major marathons.
McFadden, who won six medals at the Rio Paralympics, took the lead for good at the 15-mile mark and comfortably led the rest of the course to win for the fifth time in New York.
Marcel Hug of Switzerland won his second NYC Marathon title in the men's race and his sixth marathon this year. He edged Australia's Kurt Fearnley by sixth-tenths of a second, repeating their photo finish at last month's Chicago marathon.
Defending champion Ernst Van Dyk of South Africa came in fourth.