The structure of low-lying excitation states of even-even $N=40$ isotones is studied using a five-dimensional collective Hamiltonian with the collective parameters determined from the relativistic mean-field plus BCS method with the PC-PK1 functional in the particle-hole channel and a separable paring force in the particle-particle channel. The theoretical calculations can reproduce not only the systematics of the low-lying states along the isotonic chain but also the detailed structure of the spectroscopy in a single nucleus. We find a picture of spherical-oblate-prolate shape transition along the isotonic chain of $N=40$ by analyzing the potential energy surfaces. The coexistence of low-lying excited $0^+$ states has also been shown to be a common feature in neutron-deficient $N=40$ isotones.