Shortly after the war, in 1948 Gajewski was one of the few Polish biologists who opposed the official "new biology", lysenkoism—a pseudoscientific theory of genetics proposed by the Soviet agronomist Trofim Lysenko.
Consequently, during the Stalinist period Gajewski was not allowed any contact with students; however, he was permitted to continue his scientific work.
In 1956, with the Gomułka Thaw and the diminishing importance of lysenkoism, Gajewski was allowed to hold a position of lecturer at the University of Warsaw, where two years later, the first Polish department of genetics was established under his leadership.
During the years 1967-1981 Gajewski was the director of the Institute of Biochemistry and Biophysics of the Polish Academy of Sciences.
In 1981, when martial law was imposed in Poland, Gajewski (then retired) was initially on the list of Polish scientists that were to be arrested.