While David Hyde-Pierce was brilliant as Niles, I'm not sure the charactor him self would work as a series lead. He's better as a foil though can definately carry a scene by himself (such as the recently linked attempt to iron his trousers).
But you just do what they did with Frasier between Frasier and Cheers, change him a little, set up something new. Create a new foil. Maybe have the person who took over for Frasier leaving take all of Niles clients. He is amazing, they could have made it work.
Just like the brother on Everyone Loves Raymond, the show was shit, Raymond is awful, but his brother could have lead his own show.