The more critical part is "from go" - deus ex machina is considered bad because it's a narrative rupture. In a story of wars openly involving divine beings, there's no such discontinuity. It is also usually associated with stories that wrap up a bit too tidily, and that's also not the case in LotR.
Gandalf dies 2/6 of the way through the story and comes back 3/6 of the way through. His death may be the climax of the first two books, but his return is merely a plot beat and many of the remaining problems have yet to even be revealed, let alone solved.
Ex deus is cheap