The sentence comes after a jury in Ingushetia ruled on 26 January that the four men were members of a group who, in June 2004, killed 79 people and injured another 104.
The raid was led by the Chechen separatist commander Shamil Basaev.
All four defendants were acquitted on the charge that they had planned to take hostages at a school in the Ingush village of Nestorovskaya in the event that militants failed in September 2004 to seize a school in Beslan, in neighboring North Ossetia. The Beslan hostage crisis ended with the deaths of some 330 children, parents, and teachers.
Defense lawyers said they will appeal the prison sentences.