The "i" or "y" ending in Hungarian usually indicates 'from'. I thus read your name as from Heml.
It is most likely that when your male ancestor was required to take a surname, he or his father had come from a place called Heml.
This could be Hamel in Germany (as in the Pied Piper of Hamlin) or some place in Portugal or elsewhere, as it would not be clear whether the ancestor used the Hungarian version of the place name or the original version of the place name.