Both words have similar meanings, épier (to peek) and espionner (to spy). Also épier looks like espionner without the “s”, as many other Latin derived words that lose some “s” in French. Are these word related? I could not find their etymology.
They are definitely related but do not come from Latin.
The root is the old Frankish verb *spehôn (old German spehōną), to observe carefully which gave the French espier and later épier. The related substantives were espie and later épie (spy).
These substantives were superseded by espion under the influence of the Italian spione. This substantive finally gave a new verb espionner.
Needless to say, the English "spy" is part of the family.