N-Sulfonyl derivatives of 1,4-benzoquinone imine reacted with enamines to give 1,4-addition products and products of their subsequent cyclization, substituted 5-aminobenzofurans and 5-aminoindoles, depending on the solvent nature, electron-withdrawing power of the substituent on the quinone imine nitrogen atom, and enamine structure. The presence of strong electron-withdrawing trifluoromethanesulfonyl group on the quinone imine nitrogen atom favors formation of 1,4-addition products and benzofuran derivatives.