When goods, unlawfully taken or detained from the owner or person entitled to the possession thereof, or attached on mesne process, or taken on execution, are claimed by any person other than the defendant in the action in which they are so attached or taken, such owner or person may cause them to be replevied.