Babylon 5 had a much better plot, and stuck with it for most of the series run. DS9 felt all over the place going from the Dominion, to the Klingons, back to the Dominion, and starting with the Bajorans which they abandoned because many complained they were too boring.
DS9 had a better everything else though: commander, cast, and Villain. I kind of wished the Shadows were more developed other than the Evil "What do you want" guys. In fact, I had wished they had used Morden more in terms of "speaking for the shadows" then they had (And I actually just saw his first episode, Signs and Portants" last night). The Dominion were well developed, and had such an array of great characters like Wayoun, the female founder, and the various Jem'Hadar.
I love both shows, but neither are my favorite shows of all time. That honor goes to Farscape, which would wipe out this competition in all four attributes.