Step 1: Find the point of intersection of the two lines.
The given lines are
\[
\sqrt{3}x-y+2=0
\]
and
\[
\sqrt{3}x+y-2=0
\]
From the first line,
\[
y=\sqrt{3}x+2
\]
From the second line,
\[
y=2-\sqrt{3}x
\]
Equating,
\[
\sqrt{3}x+2=2-\sqrt{3}x
\]
\[
2\sqrt{3}x=0
\]
\[
x=0
\]
Then,
\[
y=2
\]
So, the point of intersection is
\[
(0,2)
\]
Step 2: Use the distance condition.
Point \(P\) lies on either line and is at distance \(5\) from \((0,2)\).
The lines make an angle of \(60^\circ\) with the positive \(x\)-axis.
Therefore, the vertical change in moving \(5\) units along the line is
\[
5\sin 60^\circ
\]
\[
=5\cdot \frac{\sqrt{3}}{2}
\]
\[
=\frac{5\sqrt{3}}{2}
\]
Step 3: Find the required distance on the \(y\)-axis.
Since the point of intersection has \(y\)-coordinate \(2\), the required distance from \((0,0)\) to the foot of perpendicular on the \(y\)-axis is
\[
2+\frac{5\sqrt{3}}{2}
\]
Step 4: Final conclusion.
Therefore,
\[
\boxed{2+\frac{5\sqrt{3}}{2}}
\]