27 C.F.R. § 70.207
(a) Actions permitted—(1) Wrongful levy. If a levy has been made on property, or property has been sold pursuant to a levy, any person (other than the person against whom is assessed the tax out of which such levy arose) may bring a civil action against the United States in a district court of the United States based upon such person's claim:
(ii) That such property was wrongfully levied upon.
No action is permitted under 26 U.S.C. 7426(a)(1) unless there has been a levy upon the property claimed.
(2) Surplus proceeds. If property has been sold pursuant to levy, any person (other than the person against whom is assessed the tax out of which such levy arose) may bring a civil action against the United States in a district court of the United States based upon the claim that the person:
(b) Adjudication—(1) Wrongful levy. If the court determines that property has been wrongfully levied upon, the court may:
(iv) Grant a judgment for an amount not exceeding the amount received by the United States from the sale of such property (which, in the case of property declared purchased by the United States at a sale, shall be the greater of the minimum amount determined pursuant to 26 U.S.C. 6335(e) or the amount received by the United States from the resale of such property), or the fair market value of such property immediately before the levy, with interest thereon at the overpayment rate established under 26 U.S.C. 6621 from the date of the sale of the property to the date of payment of such judgment.
For purposes of paragraph (b)(1) of this section, a levy is wrongful against a person (other than the taxpayer against whom the assessment giving rise to the levy is made), if the levy is upon property exempt from levy under 26 U.S.C. 6334, or the levy is upon property in which the taxpayer had no interest at the time the lien arose or thereafter, or the levy is upon property with respect to which such person is a purchaser against whom the lien is invalid under 26 U.S.C. 6323 or 6324(a)(2) or (b), or the levy or sale pursuant to levy will or does effectively destroy or otherwise irreparably injure such person's interest in the property which is senior to the Federal tax lien. A levy may be wrongful against a holder of a senior lien upon the taxpayer's property under certain circumstances although legal rights to enforce the holder's interest survive the levy procedure. For example, the levy may be wrongful against such a person if the property is an obligation which is collected pursuant to the levy rather than sold and nothing thereafter remains for the senior lienholder, or the property levied upon is of such a nature that when it is sold at a public sale the property subject to the senior lien is not available for the senior lienholder as a realistic source for the enforcement of the holder's interest. Some of the factors which should be taken into account in determining whether property remains or will remain a realistic source from which the senior lienholder may realize collection are: The nature of the property, the number of purchasers, the value of each unit sold or to be sold, whether, as a direct result of the distraint sale, the costs of realizing collection from the security have or will be so substantially increased as to render the security substantially valueless as a source of collection, and whether the property subject to the distraint sale constitutes substantially all of the property available as security for the payment of the indebtedness to the senior lienholder.
(3) Substituted sale proceeds. If the court determines that a party has an interest in or lien on the amount held as a fund pursuant to an agreement described in 26 U.S.C. 6325(b)(3), the court may grant a judgment in an amount equal to all or any part of the amount of such fund.
(26 U.S.C. 7426)