We study coupled quantum dots arranged in a photonic crystal, interacting with light which undergoes a quantum phase transition. At the mean-field level for the infinite lattice, we compute the concurrence of the quantum dots as a measure of their entanglement. We find that this quantity smoothly changes in the vicinity of the phase transition, and in a step-like fashion in the Mott-insulator phase. This behavior can be externally monitored through the second-order correlation function for the light in each lattice site. For the finite case, we discuss boundary induced effects using a mean-field ansatz, as well as the impact of having finite temperatures on the entanglement of the quantum dots.