This is a Laplace equation with Dirichlet boundary condition, you can construct a matrix and solve it using Matlab, or you can use Jacobi iteration to solve it manually as the number of unknowns is very small.
You start with all unknowns set to zero. Then starting from the boundary, replace each unknown with the average of its four neighbors. Since this is a puzzle, the answer is likely to be integers so you can round the result safely. After two or three iterations you get the answer. Mine is:
6, 5, 3, 2, 1 \\
5, 4, 4, 2, 1