To clear up the distinction, dermatitis is a term that refers to skin inflammation (hence the ‘itis’), whereas eczema is a more general term that applies to many types of dermatitis, but not all of them. So for example, atopic dermatitis would be considered a form of eczema, which could also include contact dermatitis, stasis dermatitis and neurodermatitis.
You can develop dermatitis without having eczema, for example, if your skin comes into contact with lots of stinging nettles and becomes inflamed, you could be said to have temporary dermatitis. Eczema sufferers can be said to be experiencing both.