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 IP1 X IP1 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 IP1 X IP1
proposed recently by Nekrasov. We also obtain the
partition functions for local IF1 and IF2 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.