If someone sees a woman’s face, and looks away, and within his own self, he says, MashAllah she’s beautiful.

Is it a sin?

The key thing is looking away
Admiring beauty without bad thoughts or lustful intentions may not be haram