for the implication from left to right, my idea is that if D is dense, then it shares elements with any open of M (no intersection is null), the set of neighborhoods of x is a filter that converges to x, if we add D to the mix we won't run in the problem of getting the null set (intersection of 2 elements of the filter is an element of the filter), and the only set that fully contains D is M itself (is it?) so the set of neighborhoods of x reunited with D should be a filter (?)
for the reciprocate, if such filter exists, then D intersects every open that contains x, applying for all x in M we get that D intersects every open of M and therefore is dense.