The sheriff or his deputy, while conveying the defendant to his proper prison in execution of a judgment of imprisonment, has the same authority to request the assistance of any citizen in securing the defendant and in retaking him if he escapes, as if the sheriff were in his own county; and every person who refuses or neglects to assist the sheriff, when so requested, is punishable as if the sheriff were in his own county.
SDCL 23A-27-31