Hint :
In general the flux through an oriented open or closed surface $\:\mathrm{S}\:$ due to a point charge $\:Q\:$ is
\begin{equation}
\Phi_{\mathrm{S}}=\dfrac{\Theta}{4\pi}\dfrac{Q}{\epsilon_{0}}
\tag{01}\label{01}
\end{equation}
where $\:\Theta\:$ the solid angle by which the charge $\:Q\:$ sees the surface.
For our case here make use of this Proposition-Practical Rule and Figure-01 both of them shown in my answer there What is the electric field flux through the base of a cube from a point charge infinitesimally close to a vertex?, repeated here for convenience.
Proposition-Practical Rule :
Let a rectangular parallelogram with sides $\,a,b\,$ and a point $\,Q\,$ positioned at a height $\,c\,$ vertically up of one of its corners, see Figure-01. Then the solid angle $\,\Theta\,$ by which the point $\,Q\,$ "sees" the rectangular parallelogram is determined by the equation
\begin{equation}
\tan\Theta=\dfrac{s}{c\!\cdot\!d}=\dfrac{a\!\cdot\!b}{c\!\cdot\!\sqrt{a^{2}+b^{2}+c^{2}}}
\tag{02}\label{02}
\end{equation}
where $\,s=a\!\cdot\!b\,$ the area of the rectangular parallelogram and $\,d=\sqrt{a^{2}+b^{2}+c^{2}}\,$ the diagonal from $\,Q\,$ to the opposite corner.
Try to prove that if $\:\Theta_1\:$ the solid angle by which your point charge sees a face parallel to the edge and $\:\Theta_2\:$ the solid angle by which your point charge sees a face normal to the edge then
\begin{equation}
\tan\Theta_1\cdot\tan\Theta_2=1
\tag{03}\label{03}
\end{equation}
Note that according to the Figure-Solid angles your charge sees the 4 not-adjacent faces by a solid angle $\:\Theta=\pi$, see Figure-03, while from equation \eqref{03} the solid angles $\:\Theta_1,\Theta_2\:$ are complementary
\begin{equation}
\Theta_1+\Theta_2=\dfrac{\pi}{2}
\tag{04}\label{04}
\end{equation}


