This paper presents a new, nondestructive method of testing brick wall dampness in wall structures. The setup was used to determine the moisture in a specially built laboratory model. Topological methods and the gradient technique are used to optimize the approach. A forward model of a wall was constructed to solve the inverse problem resulting in moisture buildup inside the wall.