Many people wrongly think that pairing the two colours in an ensemble is a no-no, however brown slacks and a black top can be worn together. Given that they go well with a wide range of hues, black and brown are both considered neutral colours in the world of fashion. Because they do not contrast, neutrals work well with any colour.
However, when worn together, black and brown rarely look good with shoes and belts. Dark brown is the only exception to this rule because it is close enough to black in hue.