Gavriil Vainer was born in 1898 (or 1899) in the town of Kletsk, 110 kilometers (approx. 70 miles) southwest of Minsk. Sometime in 1918 (or 1919), after the retreat of the German Army from the area in November 1918, he volunteered for the Red Army, later fighting in Central Asia. After the end of the Russian Civil War, Vainer was unable to return to Kletsk (Kleck), which had been annexed to Poland by the terms of the Treaty of Riga. He settled in the Soviet town of Slutsk, which was only 60 kilometers away from the Polish Kleck. He was married in Slutsk, and had four children. In the 1930s, he worked as a loader at the local railway station.
In 1939, Vainer was drafted into the Red Army and fought in the Soviet-Finnish (Winter) war. In Karelia, he was shell-shocked and frostbitten, and went on to spend a long time in a military hospital.
Following the German invasion of the Soviet Union in June 1941, Gavriil convinced his family to flee Slutsk as quickly as possible (his wife and elder children were reluctant to leave, given their semi-agricultural lifestyle) and organized their eastward flight from Belorussia. Gavriil himself was evacuated somewhat later, being drafted into the Red Army on the way; he fought as a mortar gunner.
In November 1943, Gavriil Vainer took part in the Kerch operation, when the Red Army attempted to invade the Crimean peninsula from the east. During a lull in the fighting, a stray enemy projectile hit a pile of crates with mortar shells, which Vainer and his comrades had unloaded from a truck some minutes before. Sergeant Vainer was seriously shocked and blinded in the ensuing explosion. He was taken to a hospital in Georgia. There, blind and uncertain about the fate of his family, Vainer tried to take his own life. Afterward, he was put under surveillance. Following Vainer's discharge from the hospital, the family of his brother Zinovii Vainer, who lived in Baku, Azerbaijan, took him in.
Gavriil's eldest son, Iosif Vainer (born 1925), was drafted into the Red Army in January 1943; he fought as an anti-tank gunner, was wounded, and awarded the medal "For Courage". All of Gavriil Vainer's family survived the war, and he was reunited with them in 1947. After the war, Gavriil Vainer spent 13 years at a psychiatric facility. He died in 1984.