To output in a constituent query:

On the Output tab, select:

Constituent Information, Import ID



To output in a gift query:

On the Output tab, select:

Constituent, Import ID