First determine if it is mold or a dirt mark. Put a drop of laundry bleach on it. If it is mold, it will turn grey. If it is dirt, it will lighten slightly. After the mold has been killed with bleach, proceed as if it was dirt. The first thing to do is clean the brown stains with trisodium phosphate (TSP). Even though the wall has been cleaned on the surface, the stain may linger underneath. For that reason, use a stain-block paint instead of a regular paint. Stain-block paint is a primer that will eliminate the difference in colors between the stains and the final coat of new paint.