To me ECM is more of a strategy to manage all of enterprise's content. Strategy could help companies answer various questions as - how would you manage your website/ web content? how would you do publishing? how would you digitize your existing paper based content? how would you automate data ebtry? etc. DMS happens to be an implementation ( a system) to manage electronic documents. As pointed by others, DMS is a part of ECM.
If you understand these three terms, you can see that all of them were created with the help of paper or electronic media.