The Kastler-Kalau-Walze theorem, announced by Alain Connes, shows that the Wodzicki residue of the inverse square of the Dirac operator is proportional to the Einstein-Hilbert action of general relativity. In this paper, we prove a Kastler-Kalau-Walze type theorem for 5-dimensional manifolds with boundary.