The detriment caused by the wrongful occupation of real property, in cases not embraced in §§ 21-3-6 to 21-3-9, inclusive, is deemed to be the value of the use of the property for the time of such occupation, not exceeding six years next preceding the commencement of the action or proceeding to enforce the rights to damages, and the costs, if any, of recovering the possession.
SDCL 21-3-5