3-Hydroxynaphtho[1,2-b]quinolizinium was synthesized by cyclodehydration route and its optical properties in different media were investigated. The absorption and emission spectra of this compound depend on the pH of the solution. Thus, at higher pH values the deprotonation yields a merocyanine-type dye that exhibits significantly red-shifted absorption bands and causes a dual emisson, i.e., a combination of emission bands of the hydroxyquinolizinium and its deprotonated form. Whereas this compound is a weak acid in the ground state (pK
a = 7.9), it has a strongly increased acidity in the excited state (pK
a
* = 0.4). As a result, the blue-shifted fluorescence of the hydroxyquinolizinium becomes dominant only under strongly acidic conditions. In addition, it is shown that 3-hydroxynaphtho[1,2-b]quinolizinium binds to cucurbit[7]uril (CB[7]) with moderate affinity (K
b = 1.8 × 104 M−1, pH 5) and that the pK
a and pK
a
* values of this ligand increase by about two to three orders of magnitude, respectively, when bound to CB[7].