In this paper, we perform the mathematical modeling of the thermophysical experiment of diagnosing a space under a cast-iron tubing of a vertical tubing support using optical lock-in thermography. We present the formulation and numerical solution of a two-dimensional boundary value problem of non-stationary heat exchange, including heat transfer due to thermal conductivity, natural convection, and radiation. The defect in the under-tubing space is detected based on an analysis of the distribution of the phase characteristics of the temperature fluctuations at the tubing boundary (which is available for observation) calculated by the digital lock-in correlation. The effect of the heating frequency, heating time, and noise on the distribution of phase characteristics is studied to optimize the process of active thermal non-destructive control. Based on the use of the reference temperature distribution at the tubing boundary with a defect-free tubing space, an algorithm for mathematically processing noisy data is proposed. The algorithm includes the Kalman filter, the Rauch-Tung-Striebel smoothing procedure, and a smoothing spline method with the criterial selection of the smoothing parameter. The results of the computational experiments illustrate the effectiveness of the presented approach.