The Gate of the Afterlife was a way of connecting the world of the living to the Border of the Afterlife. It was bound by chains. If a living being crossed the gate, they would instantly turn to stone and die. The only way to pass the gate unharmed was if one possessed the sword Tenseiga. It was located in a cave in the Realm of Fire. It was guarded by Gozu and Mezu.
As Hakudōshi was searching for a pathway to the Border of the Afterlife to obtain the final shard of the Shikon no Tama, he discovered the existence of the gate. He ordered Kagura to tell Inuyasha and his friends about it. When Inuyasha's group came across the gate in the Realm of Fire, they had to confront Gozu and Mezu after telling them that they wished to pass through the gate. The guardians of the gate stated that they only way to pass was if they were dead. None of their attacks had any effect on Gozu and Mezu. Inuyasha was finally able to break the chains on the gate with Tessaiga. As the gate began to open, Kagura snuck ahead with an army of yōkai. When the gate opened, a blindly light appeared that instantly turned everything it touched into stone. Kagura was able to escape just before she was hit by the light (although part of her kimono had turned to stone). When Mezu asked Kagura if she wished to pass, Kagura exclaimed that she didn't. The gate was then closed up again.
After Naraku and Inuyasha's group managed to cross to the Border of the Afterlife with Tekkei's blood, Sesshōmaru arrived at the scene. Kagura the appeared and told him about what happened with Inuyasha and Naraku. She also told him about the gateway in the Realm of Fire and how dangerous it would be for him. She led Sesshōmaru and Jaken towards the gate. She stopped and left them just before they would approach the gate and told them that they were now on their own. As Sesshōmaru approached the gate, Gozu and Mezu awoke. They asked him if they wished to pass. When Jaken said yes, they awoke and attacked them. Sesshōmaru fought back with Tōkijin, but it had no effect on the guardians. They told him that they could not be harmed by any weapon of the living world. Sesshōmaru decided to draw out Tenseiga instead. Gozu and Mezu kneeled before him and acknowledged his right to pass through the gate since he possessed Tenseiga. Sesshōmaru and Jaken were able to successfully pass through.
Since Sesshōmaru's twin elder hanyō daughter Towa got the Tenseiga, they came to the Lake of the Staff of Two Heads as it opens the bridge to gate and Inuyasha tells Gozu and Mezu that they have the Tenseiga to let them pass through and they did.