5. In the plane, there are 200 points, no three of which are collinear, and each point is labeled with one of the numbers $1, 2, 3$. All pairs of points labeled with different numbers are connected by line segments, and each line segment is labeled with a number 1, 2, or 3, which is different from the numbers at its endpoints. As a result, each of the numbers $1, 2,$ or $3$ written on the plane appears exactly $n$ times. Then the value of $n$ is
5.199.

Let the points labeled $1, 2, 3$ be $a, b, c$ respectively.
Thus, $a+b+c=200$, and the number of line segments labeled $1, 2, 3$ are $bc, ca, ab$ respectively.
Then $n=a+bc=b+ca=c+ab$.
Therefore, $(a+bc)-(b+ca)=(a-b)(1-c)=0$.
Similarly, $(b-c)(1-a)=(c-a)(1-b)=0$.
If at least two of $a, b, c$ are not 1, then $a=b=c$, which contradicts $3+200$, and it is also impossible that $a=b=c=1$.

Thus, two of $a, b, c$ are 1, and the third is 198. In this case, the equation holds, and $n=199$.