Gebrselassie was locked in a shoulder-to-shoulder battle against his compatriot and defending champion Hailu Mekonnen until the 35km mark.
As Mekonnen started to slow, Kipyego caught up with Gebrselassie after passing the 38km mark and crossed the finishing line in 2hr 07min 37sec.
Japan’s Arata Fujiwara came second in a personal best time of 2:07:48, followed by Stephen Kiprotich of Uganda in 2:07:50.
Gebrselassie finished fourth in 2:08:17, while Mekonnen was eighth in 2:09:59.
“I’m very happy to win the Tokyo marathon at my first attempt. I never knew I would win the race until the 30 kilometres (mark),” said Kipyego, 28.
In the women’s race, Atsede Habtamu of Ethiopia overtook front-running Eri Okubo of Japan after passing the 39km mark to win in 2:25:28.
Her compatriot, Yeshi Esayias, was second in 2:26:00, followed by Helena Loshanyang Kirop of Kenya in 2:26:02. Okubo finished fourth place in 2:26:08.