http://www.etymonline.com/index.php?term=engine

engine
c.1300, from O.Fr. engin "skill, cleverness," also "war machine," from L. ingenium "inborn qualities, talent," from in- "in" + gen-, root of gignere "to beget, produce." At first meaning a trick or device, or any machine (especially military); sense of one that converts energy to mechanical power is 18c., especially of steam engines. Engineer "locomotive driver" is first attested 1839, Amer.Eng.