TheBoost said: Gandalf and the Cavalry saving the day in "The Two Towers" is not a Deus Ex Machina because Gandalf left in act two to go find the characters they met in act one, to come back and save the day.
You are correct in your definition of deus ex machina. An example in LOTR would be the Eagles coming to the rescue unlooked for at the end, as they did in The Hobbit.