4. As shown in Figure 2, in rectangle $O A B C$, $O A=6, O C=5$, the graph of the inverse proportion function intersects $A B$ and $B C$ at points $E$ and $F$ respectively, and $C F<F B$. The difference in the areas of $\triangle O E F$ and $\triangle B F E$ is $5 \frac{11}{30}$. Then the inverse proportion function is ( ).
(A) $y=\frac{7}{x}$
(B) $y=\frac{12}{x}$
(C) $y=\frac{18}{x}$
(D) $y=\frac{23}{x}$
4. A.

From the given, $A(6,0), B(6,5), C(0,5)$.
Let the inverse proportion function be $y=\frac{k}{x}$. Then $E\left(6, \frac{k}{6}\right), F\left(\frac{k}{5}, 5\right)$.
Thus, $S_{\triangle O A E}+S_{\triangle O C F}=\frac{k}{2}+\frac{k}{2}=k$,
$S_{\triangle B E F}=\frac{1}{2}\left(5-\frac{k}{6}\right)\left(6-\frac{k}{5}\right)$,
$S_{\triangle O E F}-S_{\triangle B E F}$
$=\left[30-k-\frac{1}{2}\left(5-\frac{k}{6}\right)\left(6-\frac{k}{5}\right)\right]-$
$\frac{1}{2}\left(5-\frac{k}{6}\right)\left(6-\frac{k}{5}\right)$
$$
=30-k-\left(5-\frac{k}{6}\right)\left(6-\frac{k}{5}\right)=-\frac{k^{2}}{30}+k \text {. }
$$

From the problem, we have
$$
\begin{aligned}
& -\frac{k^{2}}{30}+k=\frac{161}{30} \Rightarrow k^{2}-30 k+161=0 \\
\Rightarrow & (k-7)(k-23)=0 \Rightarrow k=7,23 .
\end{aligned}
$$

Since $C F<F B$, we have $\frac{k}{5}<3 \Rightarrow k<15$.
Therefore, the inverse proportion function is $y=\frac{7}{x}$.