The Mysterious Curse of the Haunted Castle

is episode 194 of the original Naruto anime.

Synopsis
Naruto, Kiba and Hinata enter a castle in search of the Daimyo's wife. They then discover that inside there is a monster that was summoned by the castle's original occupants, and learn that the creature is seeking release from the world. Naruto destroys the contract that summoned the monster and it returns home, releasing all of its captives (including the Daimyo's wife).