A pseudo Nambu-Goldstone boson (PNGB) coupled to a confining gauge group via an anomalous term is characterised, during the confining phase transition, by a temperature dependent mass m2(T)∝T^−n. For n>2, a non-relativistic population of such particles dominating the cosmological energy density would act as dark energy (DE), accelerating the expansion. We study the possibility that a PNGB φb coupled to a hidden gauge group that is presently undergoing confinement could realise this scenario. To obtain the observed amount of DE, the number density of φb must be boosted by some mechanism. Assuming that the QCD axion φa constitutes the dark matter (DM), a non-adiabatic level crossing between φa and φb shortly before matter-DE equality can convert a small fraction of DM into DE, providing such mechanism and explaining the coincidence puzzle.