German flight instructor Werner Fries took his case to a German labour court in 2013 after his employer, Lufthansa, ended his contract when he turned 65, in line with EU law.
The German court referred the case to the European Court of Justice, the EU's highest court, which ruled that the action was legal.
Flight crew health is a sensitive issue in Germany after a Germanwings co-pilot suffering mental health problems slammed his plane into the Alps in 2015, killing all on board.
"It is undeniable that the physical capabilities essential to the profession of an airline pilot diminish with age," it added.