They hypothesised that the enzyme would not appear until the first alcohol was brewed by those early farmers, since it would not have been needed.
But researchers were amazed to find it far earlier, towards the end of the Miocene epoch.
Their discovery could explain why tree-dwelling orang-utans still cannot metabolise alcohol while not only humans but chimps and gorillas can.
"This transition implies that the genomes of modern human, chimpanzee and gorilla began adapting at least 10?million years ago to dietary ethanol present in fermenting fruit," said Professor Matthew Carrigan, of Santa Fe College in the United States.
"This conclusion contrasts with the relatively short amount of time - about 9,000 years - since fermentative technology enabled humans to consume beverages with higher ethanol content than fruit fermenting in the wild.
"Our ape ancestors gained a digestive enzyme capable of metabolising ethanol near the time they began using the forest floor.
"Because fruit collected from the forest floor is expected to contain higher concentrations of fermenting yeast and ethanol than similar fruits hanging on trees, this transition may also be the first time our ancestors were exposed to - and adapted to - substantial amounts of dietary ethanol."
Any primates unable to digest the fermented fruits would have been likely to have died before passing on their genes, but those who could cope with the ethanol would have passed the drinking gene on to their offspring.
Over time it would have become common.
The evolutionary history of the gene, ADH4, was reconstructed using data from 28 different species of mammals, including 17 primates, collected from public databases or well-preserved tissue samples.
The first evidence of man deliberately producing alcohol comes from the Neolithic village of Jiahu in northern China, where clay pots were found containing residues of tartaric acid, one of the main acids present in wine.
Some archaeologists have suggested that the entire neolithic revolution, the transition from nomadic hunting and gathering to agriculture and settlements which began about 11,000 years ago, was motivated by the quest for drinking and intoxication.
Patrick McGovern an archaeologist from the University of Pennsylvania claims that prehistoric communities cultivated wheat, rice, corn, barley, and millet primarily for the purpose of producing alcoholic beverages.
He believes that early farmers supplemented their diet with a nutritious hybrid swill which was half fruit and half wine.
The rest is history.