I don't know if this is exactly what you are looking for nor do I don't know if this is the earliest occurrence but I have seen something very similar in the Shem Mishmuel on Rosh Hashanah who seemingly ascribes the idea to the Kotzker Rebbe.
He writes at length there about the internal struggle man has and how he has to act like a "melech", a king, to ensure that these three elements don't rule over him but rather he reigns over them. The relevant excerpt reads as follows:
והנה שלשה שליטים באדם משכן לנפש רוח ונשמה ואתנחי בי' סימנא ר"ת "מלך" מוח לב כבד, ובמה שהאדם משעבד את שלשה אלה לשמים משעבד דוגמתם את מלכיות העולם ואת כל שליטיהם לשמים, היינו אותם שיש להם אחיזה בשורש נשמתו...
Behold three things rule over a man, dwelling in the soul, spirit and neshama and they can be summed up in a siman in the acronym "MeLeCh" - namely the moach (brain), lev (heart) and koved (liver). And how man adopts these three (facets) in his service to heaven serves as an example for serving the kingdoms of the world and all their rulers to heaven. This means that they have a grip on the root of his soul...
When looking further, I did a search on Sefaria and also saw it in spoken about by Rav Tzadok of Lublin (albeit in parentheses) in his Dover Tzedek - Berachos 3. He notes there that three things are needed before one goes to war - advice of intellect, advice of Torah and advice of prophecy. First comes the counsel of the intellect which is rooted in the brain as derech eretz comes prior to Torah. Next follows the advice of Torah. This is an understanding of the heart. What follows is consultation with the Urim V'Tumim which is pertinent to each particular moment. This is symbolised through the liver (see there for more details). As such:
וזה מ'ל'ך' ר"ת ג' הנז' מח לב כבד על פיהם יצא למלחמה כמשפט המלך
And this is "Melech" which is an acronym for brain, heart and liver, according to which he went to war like the king's judgement.