DC has had YEARS on Marvel. What many people fail to mention is during the Lionsgate deal Marvel only had the rights to 13 characters, who you could do an animated film with (Dr Strange, The Avengers (Thor, Iron Man, Hulk, Captain America, Hawkeye, Ant Man), Power Pack, Cloak & Dagger, Shang Chi, Black Panther and Nick Fury ) Slim picking aint it..
As I said before now Marvel has it's own animation studio and now they can do so many things in animation that they could do with LGF. I still wish Marvel could or would do Spider-Man animated features because they would sell very well.
First of all, Ultimate Avengers came out in 2006. Meanwhile, Superman: Doomsday, the first DCAU film, was released in 2007. So I am not sure about these "years" to which you refer or from what measure you have made your benchmark. Secondly, Marvel has been producing cartoons for very long time. Marvel Productions was formed in 1981 and headed up by Stan Lee (there is a documentary on Youtube if you care to look it up). Comparatively, Super Friends, was made by Hanna Barbera back in 1973, but at that time Hanna Barbera was not owned by Warner Bros (parent company of DC Entertainment). By the time the WB began making any serious effort in producing animated shows based on their properties (1992's Batman TAS), Marvel had already churned out Spider-Man, Spider-Man and His Amazing Friends, Pryde of the X-Men and The Incredible Hulk (1982 series).
Now if you are referring to WB Animation Studios in general, then yes, they have been producing cartoons since the old Looney Tunes runs from back in the 60s. However if we are strictly speaking super hero cartoons (note: I am strictly speaking super hero cartoons), then Marvel has had the leg up on Warner Bros. by a few years (eleven to be exact). However, if we are discussing cartoons produced by Marvel Productions in general, then Marvel also racked up quite a bit of content production with licensed properties e.g. Jayce and the Wheeled Warriors, Transformers, G.I. Joe etc.
Even still, Marvel had a slate of popular cartoons that Marvel Productions co-produced at the same time that Warner Bros. was seeing success with Batman TAS. During the 90s, Marvel Productions co-produced X-Men TAS as well as Spider-Man TAS, Fantastic Four, Iron Man and The Incredible Hulk (1996 series).
With all of that said, my intention was to focus on quality, but since you brought up history I felt it necessary to address the misconception. As it stands, even though Marvel has been at it for a bit longer, DC quickly mastered the craft of producing animated spin-offs of their superhero properties. Back when Marvel had no competition, a perfunctory effort was acceptable. And X-Men and Spider-Man in the 90s seem to be flukes, because just about everything else churned out by Marvel in animated form has been either unimpressive or awful. Meanwhile, almost everything DC churns out is entertaining or excellent.