4. In $\triangle A B C$, $\angle A=\frac{\pi}{3}, \sin B=\frac{5}{13}$, then the value of $\cos C$ is
4. $\frac{5 \sqrt{3}-12}{26}$.

Given $\sin B=\frac{5}{13}\pi-\frac{\pi}{6}$.
If $\angle B>\pi-\frac{\pi}{6}$, then
$$
\begin{array}{l}
\angle C=\pi-\frac{\pi}{3}-\angle B<\pi-\frac{\pi}{3}-\left(\pi-\frac{\pi}{6}\right) \\
=\frac{\pi}{6}-\frac{\pi}{3}<0 .
\end{array}
$$

This is a contradiction. Therefore, it must be that $\angle B<\frac{\pi}{6}$. Thus,
$$
\begin{array}{l}
\cos B=\sqrt{1-\left(\frac{5}{13}\right)^{2}}=\frac{12}{13} \\
\cos C=-\cos (A+B) \\
=-\cos A \cdot \cos B+\sin A \cdot \sin B \\
=-\frac{1}{2} \times \frac{12}{13}+\frac{\sqrt{3}}{2} \times \frac{5}{13}=\frac{5 \sqrt{3}-12}{26} .
\end{array}
$$