
214 Cal.App.3d 957 (1989)
266 Cal. Rptr. 657
ARTESIA MEDICAL DEVELOPMENT CO., Plaintiff and Appellant,
v.
REGENCY ASSOCIATES, LTD., et al., Defendants and Respondents.
Docket Nos. B005802, B018233.
Court of Appeals of California, Second District, Division Seven.
July 13, 1989.
*959 COUNSEL
Selvin, Weiner & Ruben, Beryl Weiner and Judith R. Seligman for Plaintiff and Appellant.
Trope & Trope, Eugene L. Trope and William B. Anderson for Defendants and Respondents.
OPINION
WALKER, J.[*] 

FACTS
Plaintiff and appellant, Artesia Medical Development Co. (herein referred to as Artesia) appeals from an award of attorney's fees of $275,000 and costs of $11,715 in favor of defendants and respondents Lite Convalescent Hospital, Inc., Fleet Financial Services, Inc., Richard J. Footner, and Quality Care Facilities, Inc. (collectively referred to as Lite.)
The action below was commenced by Artesia for unlawful detainer against its tenant, Regency Associates, Ltd. (Regency), and Lite because Artesia claimed Regency violated lease provisions against assignment of the lease without the written consent of the lessor, Artesia. This purported assignment was to the Lite defendants. The lower court found that the assignment was made without consent, and that Artesia had not unreasonably withheld consent and therefore said assignment was void and did not convey any rights to Lite.
Artesia had originally developed the premises as a health care and convalescent hospital facility. It subsequently sold the business to Regency, and entered into a long-term lease with Regency as tenant.
*960 In 1975 Regency went into possession and after a difficult period began to make a reasonable profit from its operation. The fair rental on the premises had substantially increased from the rent Regency was paying Artesia. So Regency decided to capitalize on its situation and sell its operation to Lite and assign its lease with a substantial override of rent payable to Regency. Lite, a sophisticated operator, freely and voluntarily made the deal and knowingly accepted the assignment without lessor's consent, although having assurances by Regency that the consent was no problem. Regency knew it had not obtained consent and knew it had not provided to Artesia the requisite financial documents upon which Artesia could make an intelligent informed consent to assignment, which right it had under the lease. Lite then went into possession and was in possession performing the lease at the time of trial, although no rent or payments of the sale consideration were made during the trial.
Artesia, no doubt smarting from the knowledge of the good deal Regency had made, made no heroic efforts to assist Regency in its efforts to get assignment approval, especially since the assignment and possession were accomplished even before it was informed. Substantial efforts to work something out between the parties prior to the suit were fruitless. In an obvious subterfuge, participated in by Lite, a management agreement was entered into between Lite and Regency to avoid and to conceal the default in the lease caused by the assignment. The court did not buy it. It properly held that the assignment breached the lease and determined unlawful detainer should be invoked against both Regency and Lite.
After a lengthy trial the court found against Regency and Lite and ordered judgment of forfeiture of the lease, and judgment of restoration of possession of the premises to Artesia together with substantial damages.
The Regency defendants filed notice of appeal from the said judgment. Lite filed a motion for new trial and at the same time requested equitable relief from forfeiture of the lease and to allow Lite to stay in possession under the provisions of Code of Civil Procedure section 1179.
The trial court, in exercise of its equitable power under Code of Civil Procedure section 1179, and the apparent right to change its mind, denied the motion for new trial, vacated its judgment of possession and forfeiture against Lite only and imposed various conditions, including payment in full of unpaid rents for relief from forfeiture, permitted under section 1179 of the Code of Civil Procedure.
Thereafter Lite fully satisfied all of the court's conditions imposed for relief from forfeiture.
*961 The court then entered a new and different final judgment against Regency for substantial damages, attorney fees and costs and included forfeiture of the Regency lease and transfer of all of Regency's rights to Artesia. Appeals by the Regency defendants have been abandoned.
The said judgment also ordered that Artesia take nothing from defendants Fleet Financial Services, Inc., Quality Care Facilities, Inc. and Richard J. Footner, but reserved the issue of attorney's fees against said defendants.
The judgment further ordered equitable relief from forfeiture and awarded possession of the premises to all Lite defendants, including its principals, and acknowledged that the imposed conditions for granting relief from forfeiture had "already been satisfactorily performed."
In its statement of decision supporting the final judgment the court stated "... its exercise of equitable powers has placed Lite and its principals in possession as lessees of Artesia under the same terms and conditions which the Court has found were negotiated in the abortive assignment." (Italics added.)
Presumably, both Artesia and Lite are satisfied with all the terms of the judgment except for the determination of the "Prevailing Party" and assessment of attorney's fees and costs, as all other appeals have been voluntarily dismissed or abandoned.
The court then, pursuant to the reservation in the judgment, set further proceedings to determine the "Prevailing Party" and whether or not as between Artesia and Lite either was entitled to attorney's fees and costs. In the further proceedings the court concluded that Lite was the prevailing party and awarded the fees and costs, from which order these appeals have been taken.
This case was originally tried as an unlawful detainer case for possession of the premises only. The court, with the approval of all parties, substantially expanded the litigation in an attempt to resolve various other issues between the parties, including past due rent, damages, fees and costs, as well as fixing relief from forfeiture conditions.

I

AVAILABILITY OF ATTORNEY'S FEES
A full discussion of the availability of attorney's fees to a noncontracting party is set out at length from Reynolds Metals Co. v. Alperson (1979) 25 Cal.3d 124, 127-128 [158 Cal. Rptr. 1, 599 P.2d 83] as follows:
*962 "Unless authorized by either statute or agreement, attorney's fees ordinarily are not recoverable as costs. (Code Civ. Proc., § 1021; D'Amico v. Board of Medical Examiners (1974) 11 Cal.3d 1, 24-27 [112 Cal. Rptr. 786, 520 P.2d 10]; Freeman v. Goldberg (1961) 55 Cal.2d 622, 625 [12 Cal. Rptr. 668, 361 P.2d 244]; Young v. Redman (1976) 55 Cal. App.3d 827, 834-835 [128 Cal. Rptr. 86].)
"Civil Code section 1717 provides in part: `In any action on a contract, where such contract specifically provides that attorney's fees and costs, which are incurred to enforce the provisions of such contract, shall be awarded to one of the parties, the prevailinq party, whether he is the party specified in the contract or not, shall be entitled to reasonable attorney's fees in addition to costs and necessary disbursements.' [Fn. deleted, italics in original.] [¶]
"Its purposes require section 1717 be interpreted to further provide a reciprocal remedy for a nonsignatory defendant, sued on a contract as if he were a party to it, when a plaintiff would clearly be entitled to attorney's fees should he prevail in enforcing the contractual obligation against the defendant." (Italics added.)
The lease between Artesia and Regency had a provision for attorney's fees to the prevailing party in a lease dispute.
Lite, relying on Reynolds Metals Co., supra, asserts it is not necessary to be a party to the contract to recover attorney fees under Civil Code section 1717.
The pertinent facts of Reynolds were that the plaintiff, a creditor pursuing shareholders and directors of a bankrupt corporation and its subsidiary, brought contract actions on promissory notes executed by the subsidiary and endorsed by the parent on an alter ego theory. However, the defendants, whom plaintiff was attempting to hold personally liable, were not signatories to the notes. The defendants were held not to be alter egos of the parent nor the subsidiary and prevailed on the merits and thus were awarded attorney's fees. (Reynolds Metals Co., supra, 25 Cal.3d at p. 129.)
The holding in Reynolds, a clear contractual dispute, is not helpful to Lite.
It is by no means clear that Artesia in its unlawful detainer suit against Lite for its wrongful possession of the premises was seeking to enforce a contract right in which Artesia would be entitled to recover attorney's fees *963 against Lite. On the contrary Artesia successfully had the lease declared null, void and forfeited.
It has been argued that the plaintiff in its complaint and during a portion of the proceedings prayed for and argued for an award against Lite for attorney's fees. The claim was abandoned and counsel for Artesia clearly announced such position before the final judgment. As we have concluded in any event, Artesia was not entitled to a fee award.
In the instant case Artesia sued Lite in unlawful detainer proceedings to recover possession of real property occupied by Lite under a purported assignment of a lease. The trial court determined that the assignment was invalid as the lessee, Regency, had not obtained the consent of the lessor, Artesia. Thus the court held that Lite was illegally in possession.
(1) Because the basis for the plaintiff Artesia's unlawful detainer action is founded on the proposition that Lite was in illegal and wrongful possession of the premises without consent of Artesia, it cannot be said that the action against Lite is contractual. There is no contractual basis for Artesia to recover fees against Lite, and Lite, even if it prevailed, is not entitled under Civil Code section 1717 to attorney's fees on the mutuality provisions of that statute.
The Lite defendants were included as defendants in this litigation because they had wrongfully taken possession of the premises from Regency. The lawsuit had nothing to do with any contractual relationship between the Lite defendants and Artesia, because no such relationship ever existed, nor were the Lite defendants sued by Artesia as though they were a party to the lease between Artesia and Regency. Because the Lite defendants were in possession of the premises when Artesia filed its complaint, they were necessary parties to the lawsuit, and were therefore required to be added as parties under the provisions of Code of Civil Procedure section 1164.
From the beginning of this case and continuing until the Lite defendants met all conditions ordered by the trial court for equitable relief, there was never any contractual agreement between Artesia, on the one hand, and Lite or any of the Lite defendants, on the other hand. This position was emphasized over and over again by both Artesia and the Lite defendants in both the pleadings, and during the trial. The trial court agreed. On April 26, 1983, the trial court stated: "There was no privity between Lite and Artesia....
"The privity would have arisen only if there had been a consent; ..."
*964 Even if it could be found that the Artesia action is founded in contract, we hold that Lite in wrongful possession of real property under an invalid assignment of a lease which was declared forfeited cannot now recover attorney's fees on a contract provision for such fees in the lease because Lite is not in privity with the lessor, Artesia.

II.

THE PREVAILING PARTY
Although we are of the opinion that there were no contractual rights between Artesia and Lite, Lite in any event must demonstrate that it is the prevailing party in order to receive costs or attorney's fees.
Code of Civil Procedure section 1179 provides in relevant part: "§ 1179. Relief against forfeiture; application; petition; notice; contest; condition of grant.
"The Court may relieve a tenant against a forfeiture of a lease, and restore him to his former estate, in case of hardship, where application for such relief is made within thirty days after the forfeiture is declared by the judgment of the Court, .... The application may be made by a tenant ... or any person interested in the continuance of the term. It must be made upon petition, ... and be verified by the applicant.... In no case shall the application be granted except on condition that full payment of rent due, or full performance of conditions...." (Italics added.)
(2) The procedure followed by the trial court did not comply with the procedure set out in section 1179 of the Code of Civil Procedure. In the first place the court in its original findings denied forfeiture relief even prior to the judgment. The statute requires that an application for relief must be made by verified petition within 30 days after the forfeiture is declared by the judgment of the court. The record does not reveal any verified application petition for relief from forfeiture although such intent was incorporated in the motion for new trial brought by Lite. In any event the parties may be deemed to have waived procedural defects.
(3) We do not believe that the Lite defendants who were rescued from drowning prevailed because of an act of grace (and in violation of the procedural requirements of the statute [Code Civ. Proc., § 1179]) by the court in exercise of equitable jurisdiction.
Lite lost the suit for possession but was rescued by the court from severe financial hardship, not to mention the serious inconvenience to it and its *965 patients by the discontinuance of its business, plus untold legal claims which may have arisen against it. It now wants a reward because of the rescue efforts by the court that restored it to status quo.
If Lite had chosen not to accept the imposed conditions, Artesia would now be in possession and thus is clearly the winner in the unlawful detainer action. In such event it still has no right to receive attorney's fees from anyone other than Regency.
It cannot be said therefore that by accepting the conditions the loser became the winner and prevailing party.
When the attorneys for Lite prevailed on the court to relieve it from forfeiture, equity should not be invoked in order to reward the attorneys for their efforts, particularly where their efforts did not comply with the statute (Code Civ. Proc., § 1179) and the results were largely provided by a beneficent court.
In any event the efforts of the attorneys on both sides resulted in substantial benefits to their respective clients. But neither side should on any equitable principles not imposed by contract or statute be permitted to recover from the other fees in this litigation, any more than the same attorneys having successfully negotiated a business deal equivalent to the results achieved in the litigation would recover fees from the other party.
Both parties got what they wanted. Artesia got a solvent tenant, with personal guaranties at a greatly increased rent. Lite got what it wanted, to wit: the opportunity to continue in a profitable business venture with an enforceable lease which it never had before. Equity can do no better.
This is a case of first impression in California dealing with attorney's fees in a like situation. Artesia cited a Hawaii Supreme Court case (Food Pantry, Ltd. v. Waikiki Business Plaza, Inc. (1978) 58 Hawaii 606 [575 P.2d 869]) as being directly on point. We are persuaded by the reasoning in that case.
In the Hawaii case the lessee attempted to assign and sublet the leased premises also without the consent of lessor. The lessee brought an action in declaratory relief seeking a determination that the assignment and sublease were valid. The lessor counterclaimed and asked that the court terminate the lease and award lessor attorney's fees and costs. The trial court held for the lessor, but declined to terminate the lease on equitable grounds and allowed lessee to rescind the purported assignment as condition of equitable relief from termination and denied the lessor attorney's fees and costs.
*966 On appeal the Hawaii Supreme Court affirmed the judgment and the equitable relief granted lessee. However, it held that the main issue in the lower court was the determination of the lessor's right to terminate the lease by reason of the unlawful assignment. It held on this main issue the lessor was on balance clearly the successful party in spite of the equitable relief which allowed the lessee to remain in possession. The denial of fees and costs was reversed and remanded.
We agree with the Hawaii holding. The judgment of possession and of forfeiture were the main issues in the instant case, and Artesia is on balance clearly the successful and prevailing party to the litigation.
The order awarding attorney's fees and costs to respondent is reversed and the case is remanded to the trial court to fix and award costs to the prevailing party in accordance with this decision. Costs on appeal are awarded appellant.
Lillie, P.J., and Johnson, J., concurred.
Respondents' petition for review by the Supreme Court was denied September 27, 1989.
NOTES
[*]   Assigned by the Chairperson of the Judicial Council.
