Sympathies for being stuck with FM 5. The later versions of FileMaker offer so many more options. And the issue you describe is much easier to setup in later versions that allow for more sophisticated relationship definitions.
Given that you are using version 5:
In both files, define a text calculation that looks like this: CompanyID & " " & Unit Number
Use these two fields to link your files in the lookup relationship.
When you enter both a company ID and a unit number in the respective fields of your first file (presumably a line items type file), it will look up a matching unit price from the second, matching by both CompanyID and unit number values to get the value for the appropriate company.
If you are using a third file that lists the individual line items in a portal like you should be doing. The company ID value should be entered in a field in this file and the CompanyID field in the line items table should look this value up from it so that you do not have to enter a company ID on every line of the portal.
Thanks Phil for the help I think this will work good.