"From" is correct. In fact, I can't think of an alternative.
Best wishes, - A.
Edit. You could say, "I looked out the window at him," but I don't know of a single-word prep. that can replace "from" in your sentence.
You might hear someone say, "I looked at him out the window," but I wouldn't consider it correct.
Well, I suppose you could say, "I looked at him
through the window," but it would differ from your original, since "from" works whether the window is open or closed. People often refer to the "window pane" (the glass) as "the window," but they should more correctly include the complete assembly, possibly including sashes, frames, and counterweights.
I don't know. This seems to be getting complicated. You could say, "I looked at him through the open window." I believe if you say "through the window," the window is understood to be closed. Maybe not.
Other opinions are cheerfully solicited.