Ok, here's what I'd advise:
First, make sure you understand the difference between a switch and a self-switch. You'll use switches to pass information from one event to another, while self-switches can be used within a single event to keep track of its states.
1) On the first page of your NPC1, have the dialogue telling the player to go get permission from NPC2.
2) When you get permission from the other NPC2, you need to turn on a "Permission" switch.
3) On the second page of your NPC1, set the Page Conditions (on the left of the event window) so that the page will be active when the "Permission" switch is on. This is where you put your dialogue to acknowledge and then Set Move Route to get out of the way. Note that this NPC will snap back to the original position when you leave the map (unless you use a script to save its position), so you should flip a self-switch and create a new page that will handle moving out of the way if you want to exit the dungeon before completing it. (Add a conditional branch to determine your x,y position to prevent the NPC from moving more than once and running into stuff.)
4) When the dungeon is complete, you need to turn on a "Mission Complete" switch.
5) Make another page on NPC1, set its Page Conditions to be active when "Mission Complete" is on, and put whatever dialogue you want and add the character to your party.
6) Finally, flip a self-switch and create an empty page for that self-switch so the event permanently disappears from that location.
Those are the major steps. There are of course some intermediate bits, depending on what sort of flavor you want to add to the encounter, but that should be enough for you to figure out the rest.