In general, implementing a multi-logical-qubit gate by manipulating quantum states in a decoherence-free subspace (DFS) becomes more complex and difficult when increasing the number of logical qubits. In this work, we propose an idea to realize quantum gates by manipulating quantum states outside their DFS but having the states of the logical qubits remain in their DFS before and after the gate operation. This proposal has the following features: (i) because the states are manipulated outside the DFS, the multiqubit gate implementation can be simplified when compared to realizing a multiqubit gate via manipulating quantum states within the DFS, which usually requires unitary operations over a large DFS, and (ii) because the states of the logical qubits return to the DFS after the gate operation, the errors caused by decoherence during the gate operation are not accumulated for a long-running calculation, and the states of the logical qubits are immune to decoherence when they are stored. Based on this proposal, we then present a way for realizing a multi-target-qubit controlled-not gate using logical qubits encoded in a decoherence-free subspace against collective dephasing. This gate is realized by employing qutrits (three-level quantum systems) placed in a cavity or coupled to a resonator. This proposal has the following advantages: (i) the states of the logical qubits return to their DFS after the gate operation; (ii) the gate can be implemented with only a few basic operations; (iii) the gate operation time is independent of the number of logical qubits; (iv) this gate can be deterministically implemented because no measurement is needed; (v) the intermediate higher-energy level for all qutrits is not occupied during the entire operation, thus decoherence from this level is greatly suppressed; (vi) this proposal is universal and can be applied to realize the proposed gate using natural atoms or artificial atoms (e.g., quantum dots, nitrogen-vacancy centers, and various superconducting qutrits, etc.) placed in a cavity or coupled to a resonator. As an application, we also show how to apply this gate to create a Greenberger-Horne-Zeilinger (GHZ) entangled state of multiple logical qubits encoded in DFS, and further investigate the experimental feasibility for creating the GHZ state of three logical qubits in the DFS, by using six superconducting transmon qutrits coupled to a one-dimensional coplanar waveguide resonator.