എണ്ണ came from എള് (sesame) + നെയ് (grease/fat), hinting that oil was first extracted (at least to the knowledge of mallus) from sesame.
വെണ്ണ came from വെള് (white) + നെയ് (grease/fat), obviously from the color of butter.
(The sandhi rule used in the formation of these words is ആദേശസന്ധി.)
So നെയ് originally meant just grease or fat. It also appears in compounds like നെയ്മീന്, നെയ്ച്ചൊറു്, etc. As a stand alone word, it refers to ghee or clarified butter.