  We present extensive ugrizYHJK photometry and optical spectroscopy of SN
2005gj obtained by the SDSS-II and CSP Supernova Projects, which give excellent
coverage during the first 150 days after the time of explosion. These data show
that SN 2005gj is the second clear case, after SN 2002ic, of a thermonuclear
explosion in a dense circumstellar environment. Both the presence of singly and
doubly ionized iron-peak elements (FeIII and weak SII, SiII) near maximum light
as well as the spectral evolution show that SN 2002ic-like events are Type Ia
explosions. Independent evidence comes from the exponential decay in luminosity
of SN 2005gj, pointing to an exponential density distribution of the ejecta.
The interaction of the supernova ejecta with the dense circumstellar medium is
stronger than in SN 2002ic: (1) the supernova lines are weaker; (2) the Balmer
emission lines are more luminous; and (3) the bolometric luminosity is higher
close to maximum light. The velocity evolution of the Halpha components suggest
that the CSM around SN 2005gj is clumpy and it has a flatter density
distribution compared with the steady wind solution, in agreement with SN
2002ic. An early X-ray observation with Chandra gives an upper-limit on the
mass loss rate from the companion of < 2x10^{-4} Msun/yr.
