Step 1: Use the relation between force and acceleration.
Given force,
\[
F=5\,\text{N}
\]
Using Newton's second law,
\[
F=ma
\]
So,
\[
a=\frac{F}{m}
\]
\[
a=\frac{5}{m}
\]
Step 2: Find velocity at the end of \(3\,\text{s}\).
The body starts from rest, so
\[
u=0
\]
Using
\[
v=u+at
\]
At
\[
t=3\,\text{s},
\]
we get
\[
v=0+\frac{5}{m}(3)
\]
\[
v=\frac{15}{m}
\]
Step 3: Use the formula for instantaneous power.
Instantaneous power is
\[
P=Fv
\]
Given,
\[
P=5\,\text{W}
\]
Thus,
\[
5=5\left(\frac{15}{m}\right)
\]
\[
5=\frac{75}{m}
\]
\[
m=\frac{75}{5}
\]
\[
m=15\,\text{kg}
\]
Step 4: Final conclusion.
Hence, the mass of the body is
\[
\boxed{15\,\text{kg}}
\]