adverb
in spite of oneself; involuntarily; absently
Describes acting without conscious intention, often when one's true feelings or habits slip out. Used adverbially.
See also: 我にも非ず
我にもなく涙がこぼれた。
Tears spilled in spite of myself.
彼
He was talking to himself absently.
思わず emphasizes a spontaneous, reflexive action, while 我にもなく implies acting contrary to one's usual self or conscious will.
つい is casual and often used for minor slip-ups or habits; 我にもなく is more literary and suggests a deeper loss of self-control.
From 我 (oneself) + に (particle) + も (even) + なく (adverbial form of ない, not). Literally 'not even as oneself', it developed into an adverb meaning 'involuntarily' or 'unlike oneself'.