Short answer. No. Article 1428 of the Civil Code says that when an action to enforce a civil obligation has failed and the defendant then voluntarily performs it, he cannot demand the return of what he delivered or the value of the service rendered. Having paid of your own free will after winning the case, you cannot get it back.
What the law says
When, after an action to enforce a civil obligation has failed the defendant voluntarily performs the obligation, he cannot demand the return of what he has delivered or the payment of the value of the service he has rendered.
Civil Code, Article 1428 — Performance After a Failed Suit. Read the full provision →
The rule on a natural obligation
Article 1428 provides that When, after an action to enforce a civil obligation has failed the defendant voluntarily performs the obligation, he cannot demand the return of what he has delivered or the payment of the value of the service he has rendered. This belongs to the law on natural obligations — duties that the courts will not compel, but which rest on equity and conscience. The suit failed, so no one could force you to pay; yet once you chose to pay, the law treats that voluntary act as final.
Why voluntary payment cannot be undone
The key word is voluntarily. The obligation was real enough in conscience even though it could not be judicially enforced after the action failed. When you performed it of your own accord, you satisfied that underlying duty, and the law will not let you treat your own free choice as a mistake to be reversed. To allow recovery would let a person perform and then reclaim, defeating the settled, conscientious character of what was done. This is why the payment binds only the person who chose to make it, and only to the extent he actually performed; it does not somehow bind a co-obligor who paid nothing, nor turn a single act of conscience into an enforceable debt for the future.
The limits of the article
The rule assumes the performance was genuinely voluntary. It does not shield a payment extracted by force, fraud or clear mistake, which other provisions of the law address on their own terms. Nor does it revive the failed suit or declare that you were legally liable all along — it simply refuses recovery of what you freely gave. If you are considering paying after winning a case, understand that under this article the payment is likely to be final; and if you feel your payment was not truly voluntary, keep the evidence of that, because it is the voluntariness that decides the outcome.