Who is the better writer overall?
Eh kind of tricky comparison you know. They aren't contemporaries and they both wrote for dramatically different audiences in very different times. Its a bit like comparing Snow White and Fight Club. One has a lot more depth, complexity and so on, and the other was really influential, helped create an industry and had really really good art that was probably as important to note if not more than the writing... So Gaiman's work demonstrates better pure writing technique, and it should. He comes later and is targeting an audience that can actually appreciate that level of writing. He lived and was exposed to different ideas in a different grayer world and time, than Stan Lee. If Gaiman was the same age as Lee and lived through similar experiences and worked in the same eras as Lee would we still get his best writing work? Probably not, but then again he may have been more influential and richer and famous than Lee currently is. So yeah pure writing I think Gaiman has demonstrated better, but its only natural that he should.
Seeing as how they are from 2 different eras it's really hard to compare the 2. And in the case of things that are art saying "the best" is mostly based on pure perception, like music and movies. Some people like rock and might say Nirvana or The Who are the greatest but some might say Johnny Cash or Tupac, depending on your individual preference, comics and writing are the same thing. I will say that Stan Lee is probably the most influential of the two, and if it wasn't for Stan Lee (and Kirby, Kane, Simon, Siegal and Schuster but we're talking about Gaiman and Lee so I'm only focusing on these two) it's very possible that comics wouldn't have moved to the mainstream like they are now in other medias, movies in particular. Just my thoughts though.