The angle \( \theta \) between two vectors \(\mathbf{A}\) and \(\mathbf{B}\) is given by:
\[
\cos \theta = \frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{A}\| \|\mathbf{B}\|}.
\]
Calculate the dot product:
\[
\mathbf{A} \cdot \mathbf{B} = 5 \times 6 + 3 \times (-8) + 4 \times (-1) = 30 - 24 - 4 = 2.
\]
Calculate magnitudes:
\[
\|\mathbf{A}\| = \sqrt{5^2 + 3^2 + 4^2} = \sqrt{25 + 9 + 16} = \sqrt{50} = 5 \sqrt{2}.
\]
\[
\|\mathbf{B}\| = \sqrt{6^2 + (-8)^2 + (-1)^2} = \sqrt{36 + 64 + 1} = \sqrt{101}.
\]
Therefore,
\[
\cos \theta = \frac{2}{5 \sqrt{2} \times \sqrt{101}} = \frac{2}{5 \sqrt{202}}.
\]
Hence,
\[
\boxed{
\theta = \cos^{-1} \left( \frac{2}{5 \sqrt{202}} \right).
}
\]