Under the condition of multiple wells, the inverse problem of two-phase flow typically requires hundreds of forward runs of the simulator to achieve meaningful coverage, leading to a substantial computational workload in reservoir numerical simulations. To tackle this challenge, we propose an innovative approach leveraging a surrogate model named TgCNN (Theory-guided Convolutional Neural Network). This method integrates deep learning with computational fluid dynamics simulations to predict the behavior of two-phase flow. The model is not solely data-driven but also incorporates scientific theory. It comprises a coupled permeability module, a pressure module, and a water saturation module. The accuracy of the surrogate model was comprehensively tested from multiple perspectives in this study. Subsequently, efforts were made to address the permeability-field inverse problem under multi-well conditions by combining the surrogate model with the Ensemble Random Maximum Likelihood (EnRML) algorithm. The research findings indicate that modifying the network structure allows for improved integration of the outputs, resulting in prediction accuracy and computational efficiency. The TgCNN surrogate model demonstrated outstanding predictive performance and computational efficiency in two-phase flow. By combining the surrogate model with the EnRML algorithm, the inversion results closely aligned with those from the commercial simulation software, significantly improving the computational efficiency.