We have investigated how the gene-expression profile of longevity selected lines of Drosophila melanogaster differed from control lines in young, middle-aged and old male flies. 530 genes were differentially expressed between selected and control flies at the same chronological age. We used these genes in an analysis of hierarchical clustering of lines and age groups. The results showed that longevity selected flies consistently clustered with control flies that were one age class younger. Most of the genes that were upregulated in old longevity selected flies compared to control flies of equal chronological age were downregulated with age in both control and longevity lines. This is in accordance with a younger gene expression profile of longevity selected lines. Similarly genes that were downregulated in old longevity flies compared to control flies were upregulated with older age in both control and longevity selected lines. Among the latter genes we found a clear overrepresentation of genes involved in immune functions supporting the hypothesis of the life shortening effect of an overactive immune system (inflammaging). Eighty-four genes were differentially expressed at the same physiological age between control and longevity selected lines, and the overlap between the same chronological and physiological age gene lists counted 40 candidate genes for increased longevity. Among these were genes with functions in starvation resistance, a regulator of immune responses and several genes which have not yet been linked to longevity. Investigation of these genes promises new knowledge of pathways that prolongs lifespan in invertebrates and potentially in mammals.