5. From the 12 edges and the 12 face diagonals of a cube, select $n$ lines such that any two of these lines are skew lines. Then the maximum value of $n$ is ( ).
(A) 3
(B) 4
(C) 5
(D) 6
5.B.

As shown in Figure 2, take $A B_{1}$, $B C_{1}$, $C D_{1}$, and $D A_{1}$. Clearly, they are pairwise skew, so $n \geqslant 4$. Furthermore, the required skew lines intersect the surface of the cube at distinct points, and there can be at most 8 such points, so $n \leqslant 4$.