
380 N.W.2d 644 (1986)
D.C. TRAUTMAN COMPANY, Plaintiff and Appellant,
v.
FARGO EXCAVATING COMPANY, INC., Great American Insurance Company, Dakota Bank & Trust Company of Fargo, City of Fargo, Defendants, and
Royal Jewelers, Inc., Defendant and Appellee.
Civ. No. 10993.
Supreme Court of North Dakota.
January 22, 1986.
Wegner, Fraase, Nordeng & Johnson, Fargo, for plaintiff and appellant; argued by Mervin D. Nordeng.
Gunhus, Grinnell, Klinger, Swenson & Guy, Moorhead, for defendant and appellee; argued by Dean A. Hoistad.
ERICKSTAD, Chief Justice.
The plaintiff, D.C. Trautman Company (Trautman), appeals from a district court judgment dismissing its claim against the defendant, Royal Jewelers, Inc. (Royal Jewelers), and from an order denying Trautman's request for a new trial. We affirm.
During June 1981, Fargo Excavating, Inc. (Fargo Excavating), contracted with the City of Fargo to demolish and remove certain structures in the downtown Fargo area in preparation of a site for a new *645 building to be erected by the Dakota Bank & Trust Company of Fargo. One of the buildings to be demolished, referred to as the R & G Bootery building, was located adjacent to the Royal Jewelers building and separated from that building by a common wall. During the course of the demolition, extensive damage occurred to the common wall. Thereafter, pursuant to a written directive by the Fargo City Engineer's Office, Fargo Excavating entered an oral agreement with Trautman to have Trautman repair and strengthen the common wall. To accomplish the task, Trautman expended, in labor and materials, $36,705.71.
When Trautman received no payment for the work, it brought this action seeking payment from the defendants. Prior to trial, Trautman entered a settlement agreement with Fargo Excavating, Great American Insurance Company, Dakota Bank & Trust Company of Fargo, and the City of Fargo, each of whom assigned to Trautman any rights it might have against Royal Jewelers. Trautman proceeded to trial against Royal Jewelers on an equitable theory of unjust enrichment. At the close of Trautman's case, the trial court entered a judgment dismissing Trautman's claim against Royal Jewelers on the ground that it had failed to establish the elements necessary for recovery on a theory of unjust enrichment. On appeal, Trautman asserts that the trial court erred in its determination that Trautman was not entitled to a recovery, in equity, from Royal Jewelers.
The doctrine of unjust enrichment serves as a basis for requiring restitution of benefits conferred in the absence of an express or implied contract. Sykeston Township v. Wells County, 356 N.W.2d 136 (N.D.1984). The doctrine rests upon quasi-contractual principles to prevent a person from unjustly enriching himself at the expense of another. Jerry Harmon Motors, Inc. v. Heth, 316 N.W.2d 324 (N.D. 1982). However, to recover under a theory of unjust enrichment one must prove the following five elements which are set forth in A & A Metal Buildings v. I-S, Inc., 274 N.W.2d 183, 189 (N.D.1978):
"1. An enrichment;
"2. An impoverishment;
"3. A connection between the enrichment and impoverishment;
"4. Absence of a justification for the enrichment and impoverishment; and
"5. An absence of a remedy provided by law."
Having reviewed the record, we conclude that the trial court's determination that Trautman failed to prove the elements necessary for a recovery under a theory of unjust enrichment was not error. The record supports the court's determination that Trautman failed to prove that the repair of the common wall constituted an unjust enrichment to Royal Jewelers for which, in equity and justice, Royal Jewelers should have to pay.
The demolition contract between the City of Fargo and Fargo Excavating expressly provided that common walls for nondemolished buildings were to remain functioning as exterior walls:
"Common walls shall be treated as belonging to the building which is to remain. The wall shall be inspected and repaired as needed to function as an exterior wall."
Royal Jewelers, as an owner of a common wall which was to remain intact at the conclusion of the demolition project, was an intended third party beneficiary under the contract with enforceable rights to have the wall "repaired as needed to function as an exterior wall." See Section 9-02-04, N.D.C.C. Consequently, the repair of Royal Jewelers' common wall did not constitute a gratuitous benefit or unjust enrichment for Royal Jewelers; rather, it constituted the accomplishment of a repair to which Royal Jewelers was rightfully entitled.
A party is not entitled to equitable relief if there is a remedy provided by law which is equally adjusted to rendering complete justice. See A & A Metal Buildings, supra. Trautman had such a *646 remedy in this case. The trial court found that Trautman had an oral agreement with Fargo Excavating to perform the repair work and that Fargo Excavating, pursuant to that agreement, was liable to Trautman for the entire amount of the project, together with interest. Those findings by the trial court are supported by the evidence in the record and are not clearly erroneous. Accordingly, Trautman had an adequate remedy at law for breach of contract which precludes alternative equitable relief.
Trautman also asserts that the trial court erred in requiring it to "prove the amount of defendant Royal Jewelers Inc.'s possible set-off." With regard to this issue, we believe Trautman has misconstrued the trial court's findings and determination. In its memorandum and order denying a new trial, the court, in concluding that Trautman failed to establish the elements for recovering under an unjust enrichment theory, stated in relevant part:
"Plaintiff offered no evidence of how the position of Royal Jewelers, Inc., was improved or enriched beyond the condition originally contemplated by the agreements between the Plaintiff and the Defendants Fargo Excavating, Great American Insurance Company, Dakota Bank & Trust Company, and City of Fargo.
"Iron anchors were installed to stablize [sic] the Royal Jewelers wall to a condition contemplated by the original demolition plans and agreements. However, the Plaintiff has offered no way for the Court to measure or determine how much more stable the wall may have become by the Plaintiff's efforts. Plaintiff has failed to meet its burden of proof to establish what part, if any, of its claim for damages should be apportioned to and the responsibility of Royal Jewelers, Inc. Plaintiff's claim for unjust enrichment simply cannot be reasonably or accurately established."
The foregoing statement by the trial court does not address or propose a "set-off" theory. Rather, it is a statement by the trial court that Trautman failed to prove that Royal Jewelers was unjustly enriched by the repair of the wall and that part of the inadequacy of proof was Trautman's failure to demonstrate to what extent, if any, the wall was improved beyond the condition to which Royal Jewelers was rightfully entitled. In essence, the trial court determined that Trautman failed to prove the elements of its own case for equitable relief against Royal Jewelers. Consequently, we conclude that the trial court did not err in refusing to grant Trautman a new trial with regard to this issue.
In accordance with this opinion, the judgment of the district court dismissing Trautman's claim against Royal Jewelers on its merits and the order denying a new trial are affirmed.
GIERKE, VANDE WALLE and MESCHKE, JJ., and PEDERSON, Surrogate Justice, concur.
PEDERSON, Surrogate Justice, sitting in place of LEVINE, J., disqualified.
