<PAGE>
                                                                    EXHIBIT 10.5

                                                                  CONFORMED COPY

                           FIRST AMENDED AND RESTATED
                     FEDERAL INCOME TAX ALLOCATION AGREEMENT

         Agreement made and entered into effective as of the 10th day of May
2002 by and among Gulf Polymer & Petrochemical, Inc. (GPPI), a Delaware
corporation and Westlake Chemical Corporation, a Delaware corporation; Westlake
Olefins Corporation, a Delaware corporation; Westlake Polymers LP, a Delaware
limited partnership, as successor in interest to Westlake Polymers Corporation,
a Delaware corporation; Westlake Petrochemicals LP, a Delaware limited
partnership, as successor in interest to Westlake Petrochemicals Corporation, a
Delaware corporation and WPE Corporation, a Delaware corporation; Westlake
Management Services, Inc., a Delaware corporation; Westlake Resources
Corporation, a Delaware corporation; Westlake Monomers Corporation, a Delaware
corporation; Westlake PVC Corporation, a Delaware corporation; North American
Pipe Corporation, a Delaware corporation; Westlake Vinyl Corporation, a Delaware
corporation; Westlake International Corporation, a Delaware corporation; Van
Buren Pipe Corporation (formerly NAPCO Manufacturing Corporation), a Delaware
corporation; Westech Building Products, Inc. (formerly PVC Pipe Manufacturing
Corporation), a Delaware corporation; WPT LP, a Delaware limited partnership, as
successor in interest to WPT Corporation, a Delaware corporation; Westlake AR
Corporation, a Delaware corporation; Westlake CA&O Corporation, a Delaware
corporation; Westlake Polymer & Petrochemical, Inc., a Delaware corporation;
Westlake Technology Corporation, a Delaware corporation; Westlake Styrene LP, a
Delaware limited partnership, as successor in interest to Westlake Styrene
Corporation, a Delaware Corporation; North American Profiles, Inc. (formerly
Westech Windows, Inc.) a Delaware Corporation, Westlake Chemical Holdings, Inc.,
a Delaware Corporation; Westlake Chemical Manufacturing, Inc., a Delaware
corporation; Westlake Chemical Investments, Inc., a Delaware corporation;
Westlake Chemical Products, Inc., a Delaware corporation; Westlake Development
Corporation, a Delaware corporation; Gramercy Chlor-Alkali Corporation, a
Delaware corporation (collectively, the "GPPI Subsidiaries" and individually a
"GPPI Subsidiary").

         WHEREAS, GPPI is the common parent and each of the GPPI Subsidiaries is
a member of an affiliated group of corporations within the meaning of Section
1504 (a) of the Internal Revenue Code of 1986, as amended (the "Code") (such
affiliated group as constituted from time to time is hereinafter referred to as
the GPPI Group) which files a consolidated federal income tax return; and

         WHEREAS, GPPI and the GPPI Subsidiaries agree that it would be mutually
beneficial to provide for payments by the GPPI subsidiaries to GPPI (or by GPPI
to the GPPI Subsidiaries) in respect of the federal income tax payable (or
federal income tax receivable) by the GPPI Group;

<PAGE>


         WHEREAS, GPPI and the GPPI subsidiaries entered into as of the 7th day
of April, 1995 a Federal Income Tax Allocation Agreement which agreement was
amended effective August 29, 1997, April 6, 2000 and January 1, 2001 to include
additional GPPI subsidiaries (the agreement as amended being hereinafter
referred to as the "Agreement"); and,

         WHEREAS, GPPI and the GPPI subsidiaries desire to amend and restate the
Agreement in its entirety.

         NOW, THEREFORE, in consideration of their covenants contained herein,
GPPI, and the GPPI Subsidiaries do hereby agree to amend and restate the
Agreement in its entirety according to the terms contained herein.

         1.       Consolidated Federal Income Tax Returns and Payment of
                  Consolidated Tax Liability

         If GPPI files consolidated federal income tax returns, so long as my
GPPI Subsidiary is a member of the GPPI Group, it shall join in the filing by
GPPI of its consolidated federal income tax return, and shall file such
consents, elections and other documents as my be necessary or appropriate to
carry out the purposes of this Section 1. GPPI shall be responsible for the
payment of all federal income taxes for the GPPI Group to the Internal Revenue
Service ("IRS"), and shall be entitled to receive all refunds of such taxes.
GPPI is hereby irrevocably constituted the exclusive agent and attorney-in-fact
of the GPPI Group to file such returns, pay such taxes, and take any action
reasonably necessary or appropriate in connection with the determination of the
ultimate liability of the GPPI Group for such tax, including, without limiting
the generality of the foregoing, contesting the assessment of any deficiency,
entering into any closing agreement, compromise or settlement, filing any
amended return, and prosecuting any action for a refund, on behalf of the GPPI
Group.

         2.       Payment by the GPPI Subsidiaries to GPPI in Respect of the
                  GPPI Subsidiaries' Tax Liability

                  (a) During each of GPPI's taxable years for which it files a
consolidated federal income tax return in which any GPPI Subsidiary is a member
(a "Consolidated Return Year") each GPPI Subsidiary will deposit with GPPI prior
to or concurrent with the due date of each quarterly estimated tax payment of
GPPI to the IRS, an amount established by an officer of GPPI and such GPPI
Subsidiary as appropriately reflecting the estimated tax (if any) which would be
payable by such GPPI Subsidiary on such date if it filed a separate federal
income tax return for such year. On or prior to the 30th day following the
filing of the GPPI Group's consolidated federal income tax return for a
Consolidated Return Year, payment shall be made by such GPPI Subsidiary to GPPI
or by GPPI to such GPPI Subsidiary, as appropriate, to reflect the difference
between the amounts paid by such GPPI Subsidiary to GPPI in respect of the
estimated taxes for such


<PAGE>


Consolidated Return Year and the amount of federal income tax which such GPPI
Subsidiary would have paid for such Consolidated Return year if it had filed a
separate federal income tax return for such year.

                  (b) In computing the amount of a GPPI Subsidiary's federal
income tax for any Consolidated Return Year under (a) above, such GPPI
Subsidiary will not take into account any tax attribute from any prior years
(computed on the basis described in (a) above) to the extent that any such
attribute was the basis for a payment by GPPI to such GPPI Subsidiary with
respect to a prior Consolidated Return Year under Section 3 below; provided,
however, that such incident shall be taken into account (i) in the event such
payment is refunded by such GPPI Subsidiary to GPPI pursuant to Section 4(a); or
(ii) if such GPPI Subsidiary elects to refund such prior payments to GPPI.

3.       Payment by GPPI to the GPPI Subsidiaries for Use of the GPPI
         Subsidiaries' Tax Attributes ,

         If for any Consolidated Return Year, any GPPI Subsidiary has a tax
attribute (such as a net operating loss or credit) that reduces the consolidated
tax liability of the GPPI Group, GPPI shall pay to such GPPI Subsidiary the
amount of such reduction within 30 days after the filing of the return, or in
the case of a refund--30 days within receipt of a refund. If the GPPI Group has
sufficient taxable income to absorb the tax attributes of all GPPI Subsidiaries
that have such tax attributes, the amount of reduction shall equal the excess
amount that would be paid by the GPPI Group if the GPPI Subsidiary did not have
such tax attribute. If the GPPI Group does not have sufficient taxable income to
absorb the tax attributes of all GPPI Subsidiaries, the amount of the reduction
shall be computed as follows: First, as to each Subsidiary that has such tax
attributes, compute the amount by which such GPPI Subsidiary's attributes would
reduce the consolidated tax liability (the "Maximum Reduction") of the GPPI
Group if the GPPI Group had sufficient taxable income to absorb the tax
attributes of all GPPI Subsidiaries. Second, compute the actual tax reduction
(the "Actual Reduction") in the consolidated tax liability of the GPPI Group
caused by all the tax attributes of all GPPI Subsidiaries that have such tax
attributes, such amount being the difference between the amount of the GPPI
Group consolidated tax liability if the GPPI Subsidiaries had not incurred all
such tax attributes over the actual consolidated tax liability of the GPPI
Group. The amount of reduction attributable to the attributes of any GPPI
Subsidiary shall then equal the product of the Actual Reduction and a fraction,
the numerator of which is the Maximum Reduction with respect to such GPPI
Subsidiary and the denominator of which is the aggregate Maximum Reductions for
all GPPI Subsidiaries.

4.       Audit Adjustments and Other Matters

                  (a) In the event a "determination" within the meaning of
section 1313 of the Code is reached or upon filing of an amended return which
results in any adjustment to the tax returns of the GPPI Group or of any GPPI
Subsidiary, the liabilities of GPPI and the GPPI Subsidiaries under Sections 2
and 3 above, including any applicable penalties and interest thereon, shall be
redetermined to give effect to such adjustment.

<PAGE>


Payments by GPPI and the GPPI Subsidiaries to reflect any such
finally-determined liabilities, including interest payable thereon measured from
the date 120 days after the end of the year to which such adjustment relates,
shall be made within 120 days after the determination causing such adjustment is
reached.

                  (b) If any payment required by this Agreement is not timely
paid, interest shall accrue on the unpaid amount at the rate provided with
respect to deficiencies under the Code or under any successor act.

                  (c) An officer of GPPI and each GPPI Subsidiary affected by a
particular calculation required under this Agreement will review such
calculation and agree thereto. The final decision of such officers will control
for financial reporting and for purposes of settlement between GPPI and such
GPPI Subsidiary, unless otherwise determined by the respective Boards of
Directors of GPPI and such GPPI Subsidiary.

                  (d) GPPI and each GPPI Subsidiary will each have access to the
books, records and papers of the other which bear upon the calculations and
determinations hereunder and will each have the right to participate in and be
kept fully informed about IRS examinations, similar state examinations, and
other administrative and judicial proceedings which could bear upon the amount
of payments hereunder.

                  (e) For purposes of this Agreement, the federal income tax
liability which each member of the GPPI Group would incur if it were filing a
separate return, and any payments made in respect thereof, shall be determined
in accordance with Treas. Reg. Section 1.1552-1(a)(2) Notwithstanding the
foregoing, in the event that alternative minimum tax is payable, the alternative
minimum tax shall be apportioned among GPPI and the GPPI Group in accordance
with Sections 2 and 3 above.

         5. Term

                  (a) This First Amended and Restated Federal Income Tax
Allocation Agreement shall retain the effective date of the Agreement, November
1, 1993, and shall continue in effect until terminated or canceled, as
hereinafter provided. If terminated or canceled, the Agreement shall
nevertheless continue to apply to all Consolidated Return Years and that part of
any Consolidated Return Year ending prior to the date of cancellation or
termination including adjustments pursuant to Section 4 with respect to such
years.

                  (b) This Agreement may be canceled by GPPI as of the first day
of any month with respect to any GPPI Subsidiary by giving such GPPI Subsidiary
notice of such cancellation.

                  (c) This Agreement shall terminate with respect to a
particular GPPI Subsidiary if GPPI and such GPPI Subsidiary cease to be included
in the same consolidated federal income tax return of the GPPI Group.

<PAGE>


         6. General

                  (a) This Agreement supersedes all prior agreements between
GPPI and the GPPI Subsidiaries pertaining to the subject matter of this
Agreement.

                  (b) GPPI and each GPPI Subsidiary agree that if such
Subsidiary merges into, is consolidated with, or transfers substantially all its
assets to another consolidated corporation within the GPPI Group, such surviving
corporation shall succeed to the rights and obligations of such GPPI Subsidiary
herein, and all covenants and agreements in this Agreement shall be binding
upon, and shall inure to the benefit of, such surviving corporation.

                  (c) The parties intend that this Agreement shall apply to all
corporations which are or which may become members of the GPPI Group. GPPI and
the GPPI Subsidiaries agree that they will make every reasonable effort to
ensure that any corporation that becomes a member of the GPPI Group agrees to be
bound by the terms of this Agreement.

                  (d) Except as provided in (b) above, this Agreement may not be
assigned by any party without the other parties' prior written consent.

                  (e) The validity, interpretation and performance of this
Agreement will be controlled and construed under the laws of the State of
Delaware.

                  (f) This Agreement may be executed simultaneously in several
counterparts, each of which shall be deemed an original, but all of which
together shall constitute one and the same instrument.

                  (g) All notices hereunder shall be in writing.

IN WITNESS WHEREOF, the. parties hereto have duly executed this Agreement on the
day and year first above indicated.


                         [SIGNATURES ON FOLLOWING PAGE]


<PAGE>


GULF POLYMER AND PETROCHEMICAL, INC.
WESTLAKE CHEMICAL CORPORATION
WESTLAKE OLEFINS CORPORATION
WESTLAKE MANAGEMENT SERVICES, INC.
WESTLAKE RESOURCES CORPORATION
WESTLAKE MONOMERS CORPORATION
WESTLAKE PVC CORPORATION
WESTLAKE VINYL CORPORATION
WESTLAKE INTERNATIONAL CORPORATION
WESTLAKE CA&O CORPORATION
WESTLAKE TECHNOLOGY CORPORATION
WESTLAKE POLYMER & PETROCHEMICAL, INC
WESTLAKE AR CORPORATION
WESTLAKE CHEMICAL INVESTMENTS, INC.
WESTLAKE CHEMICAL HOLDINGS, INC.
WESTLAKE DEVELOPMENT CORPORATION
GRAMERCY CHLOR-ALKALI CORPORATION

By:         /s/ A. Chao
     ------------------------------------------------
            Albert Chao, President

WESTLAKE POLYMERS LP
WESTLAKE PETROCHEMICALS LP
By: WESTLAKE CHEMICAL INVESTMENTS, INC., General Partner

By:         /s/ A. Chao
     ------------------------------------------------
            Albert Chao, President

WPT LP
WESTLAKE STYRENE LP
By: WESTLAKE CHEMICAL HOLDINGS, INC., General Partner

By:         /s/ A. Chao
     ------------------------------------------------
            Albert Chao, President

WESTLAKE CHEMICAL MANUFACTURING, INC.
WESTLAKE CHEMICAL PRODUCTS, INC.

By:         /s/ Harold F. Kalbach, Jr.
     ------------------------------------------------
            Harold F. Kalbach, Jr. Vice President

NORTH AMERICAN PIPE CORPORATION
VAN BUREN PIPE CORPORATION
WESTECH BUILDING PRODUCTS, INC.
NORTH AMERICAN PROFILES, INC.


By:         /s/ John A. Labuda
     ------------------------------------------------
            John A. Labuda, President