Green’s Dictionary of Slang

gun n.2

[‘perhaps from an allusion to a vessel called a gun, used for ale in the universities’ (Grose, 1785)]

[mid-17C–18C] a flagon of ale.

In phrases

in the gun (adj.)

[late 17C–early 19C] drunk, tipsy.