The lien given by R. S., c. 91, § 27, for labor performed, or materials furnished, in the erection of buildings, does not take precedence of a mortgage, otherwise valid and recorded before the labor or material, were contracted for; the mortgagee not being the party by virtue of a contract with whom, or by whose consent, the services were rendered or the materials were supplied.
In such case, where materials are delivered, or work is done, under a contract with the mortgagor, who is in possession and completing the house, subject to the mortgage, it is only to the equity of redemption that the lien attaches ; only to such interest in the premises as belongs to the man by whose contract or consent the labor or materials are furnished. The lien can hold against such a mortgagee, only in cases where he has become a party to the delivery of the materials, or to the work , done, by consent tacitly or expressly given. The law was so declared in Cocheco Bank v. Berry, 52 Maine, 293, 304, cited for the respondents, and no change in this respect was intended by the later acts, nor by the revision of 1871. The contract or consent of the owner must go along with the delivery of the *354materials to give the lien, and when these are made part of a mortgaged estate, at least the knowledge of the mortgagee must in some way appear, before the written notice mentioned in E. S., c. 91, § 28, (amended 1876, c. 140,) can be required from him in order to prevent a later claim from taking precedence of the mortgage. It is only to the extent that the mortgagor is the owner, within the meaning of E. S., c. 91, § 27, that his consent can give the lien; that is to say, only within the limits of a mortgagor’s interest.
In order to give the statutory lien on a vessel, no contract or consent of the general owner is in terms required. The language of the two sections differs in this respect. So many distinct considerations, too, affect the law relating to liens on vessels, that little is gained by attempting air analogy between them and the mechanic’s lien under the statute on buildings erected, altered or repaired. In this last case, it is clear that no agreement between the mortgagor and the mechanic or the material man, after the mortgage is recorded, can subject the structure, or the lands on which it stands, to an incumbrance, great or small, which displaces the mortgage, without the knowledge or against the will of the mortgagee.
In the present case, there is no evidence that the respondents, the mortgagees, had ■ any knowledge whatever, at the time, of the rendering of the services or of the delivery of the materials, for which the lien is claimed. The contrary, rather, is proved. Their consent, therefore, cannot be implied. Nor was the written notice mentioned in § 28 required of them to prevent the lien.
Many of the articles included in the lien judgments, on which the levies were made which gave the petitioners their claim of title, were delivered after April 20, 1877, the date of the record of the mortgage to the respondents. The cases cited sufficiently show that a judgment which includes both lien claims and non-lien claims is not effective as a judgment for a lien. If these later items, then, are not lien claims the petitioner's’ source of title is the attachment, which in each instance was later than the record of the respondents’ mortgage.
But it is claimed that while these articles were delivered after April 20, 1877, they were delivered under contracts in force *355between the petitioners and the mortgagor when the mortgage was given and recorded, by which the petitioners were under a legal obligation to deliver them; so that the mortgagor could, have demanded the delivery as a legal right, and held them in damages if they did not comply.
To whatever extent this is true, we think it would give the lien as against the mortgage. In such case, the mortgagor remaining in possession and control without interference on the-part of the mortgagee, performance of the contract under which-the lien accrued would give the prior right. Whether the mortgagee might have taken possession and discharged the contract, or refused to accept anything more under it, and thereby have prevented the extension of the lien, is not the question here. The mortgagor remained in possession and accepted the materials and labor charged. Under these circumstances, the security of' the lien which the law attached to the performance of the contract was superior to all later incumbrances upon the interest which the contracting owner had in the premises at the date of' the contract. The mortgagor, allowed by the later mortgagee to remain in position to enforce the contract and compel its. performance, must be in position, also, to give the lien on his interest as it stood when the contract was made; the lien on that interest being legally the inseparable companion of the contract, keeping pace with it as fast as it is performed. Gale v. Blaikie, 126 Mass. 274.
So far as the first clas? of petitioners are concerned, those who-compose the firm of Morse and Company, no such contract is proved. It is their own statement that their agreement was to furnish the lumber, or a portion of it at any rate; without specifying the. amount, or that it was to be all that went into the house. "I agreed to sell him what lumber he wanted from time to time to put into that house. At any time if we had thought we were not going to get our pay, we should have felt at liberty not to furnish it.” The whole statement of Mr. Morse, in regard to the matter, shows that the firm was not compelled by the force of' any contract to deliver lumber after the date of the respondents’ mortgage. They did not act upon such an understanding of it.
*356Their judgment included items which as against the mortgage are non-lien claims, and the levy of the execution issued upon it, if otherwise effective, left their interest still subject to the rights of the mortgagees. They have no right of partition of the real estate with them. As to these petitioners, judgment must be rendered against them, and for the respondents for costs.
As to the other petitioners, composing the firm of Gretchell, Leighton and Company, we think the evidence rather inclines in favor of their claim, that all the items charged in their bill were furnished under a contract in force when the mortgage was given.
The only witness on this point so states it; that the mortgagor '"was bound to call upon us for everything in our line, extra or not. We did the work rather low and that was a part of the •contract, to furnish all the extras.” There are contradictions in his testimony, and it is with some hesitation that we reach this result.
The judgment which Gretchell, Leighton and Company, recov- • ered against the mortgagor having been rendered on default, ail the items in the account annexed with the prices were thereby admitted. There was an error in the addition by which the 'balance due was reduced two dollars below what- actually appeared to be due on the account. The sum of two dollars is more than the two non-lien claims charged. They aibount only 'to one dollar and fifty cents. Under the circumstances, we think their presence in the account does not prevent the judgment sbeing effective as one for a lien. Upon correct computation of 'the items admitted by the default, the judgment did not exceed '.the amount of the lien claims.
As to the petitioners composing the firm of Morse and Company, partition denied, with costs for respondents.
As to the petitioners composing the firm of Getchell, Leighton and Company, judgment for partition prayed for, with costs.
A tut,eton, C. J., Barrows, Virgin and Peters, JJ., concurred.