It has been assumed that Nb and Ta are not fractionated during differentiation processes on terrestrial planets and that both elements are lithophile. High-precision measurements of Nb/Ta and Zr/Hf reveal that Nb is moderately siderophile at high pressures. Nb/Ta values in the bulk silicate Earth (14.0 +/- 0.3) and the Moon (17.0 +/- 0.8) are below the chondritic ratio of 19.9 +/- 0.6, in contrast to Mars and asteroids. The lunar Nb/Ta constrains the mass fraction of impactor material in the Moon to less than 65%. Moreover, the Moon-forming impact can be linked in time with the final core-mantle equilibration on Earth 4.533 billion years ago.