He dies much later! It's misleading to suggest he dies after he goes to the city...
He gets in a big fight with King Gilgamesh (who defeats him) and after which they become friends. They go on adventures together and do many great things. When Enkidu dies, Gilgamesh goes on a final quest to discover the secrets of living forever, and possibly return his best friend Enkidu to life again.