The old definition of an 'engine' was anything of a mechanical type
But its etymology is actually from the Latin, ingeniator, literally, one possessed of ingenium, which itself comes from ingeniāre, meaning 'to contrive'. From that, Middle French acquired ingénieur, and this is where we get our word ingenious. In the 14th century it found its way into many languages, including Anglo-Norman and French for engigneour, associated particularly with one who constructs military works, although the military usage co-existed with that to mean more general fabrication.
Indeed, even in 1380 we see: "Þe Amyral made his engyneour þe engyns to sette & bende."
That said, I possess a great displeasure for those who confer the title of Engineer upon someone who is not qualified by degrees or institution to use it.