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, for almost ten years of the Stalinism era, Gajewski was not allowed any contacts to students; however, he was permitted to continue his scientific work.
In 1956, with the fall of the Stalinism era and the diminishing importance of lysenkoism, Gajewski was allowed to hold a position of lecturer at the Uniwersytet Warszawski, 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 introduced in Poland, Gajewski (then retired) was initially on the list of Polish scientists that were to be arrested.