The equivalence between the Chern-Simons gauge theory on a three-dimensional manifold with boundary and the WZNW model on the boundary is established in a simple and general way using the BRST symmetry. Our approach is based on restoring gauge invariance of the Chern-Simons theory in the presence of a boundary. This gives a correspondence to the WZNW model that does not require solving any constraints, fixing the gauge or specifying boundary conditions.