The instanton partition function of N = 2, D = 4 SU(2) gauge theory is obtained by taking the field theory limit of the topological open string partition function, given by a Chern-Simons theory, of a CY3-fold. The CY3-fold on the open string side is obtained by geometric transition from local IP{sup 1} x IP{sup 1} which is used in the geometric engineering of the SU(2) theory. The partition function obtained from the Chern-Simons theory agrees with the closed topological string partition function of local IP{sup 1} x IP{sup 1} proposed recently by Nekrasov. We also obtain the partition functions for local F{sub 1} and F{sub 2} CY3-folds and show that the topological string amplitudes of all three local Hirzebruch surfaces give rise to the same field theory limit. It is shown that a generalization of the topological closed string partition function whose field theory limit is the generalization of the instanton partition function, proposed by Nekrasov, can be determined easily from the Chern-Simons theory.