Etymology

nightcap (n.)

also night-cap, late 14c., "covering for the head, worn in bed," from night + cap (n.). In the alcoholic sense, it is attested from 1818. American English sense of "final event in a sporting contest" (especially the second game of a baseball double-header) is by 1924.

Sunday's baseball opening brought out New York vs. Cleveland in the first game. with Philadelphia and Cincinnati as the star attraction in the nightcap number. [The Typographical Journal, September 1923]

updated on July 08, 2019

Definitions of nightcap from WordNet

nightcap (n.)
an alcoholic drink taken at bedtime; often alcoholic;
nightcap (n.)
a cloth cap worn in bed;
nightcap (n.)
the final game of a double header;
Etymologies are not definitions. From wordnet.princeton.edu, not affiliated with etymonline.