Energy conservation does work perfectly in general relativity. The overall Lagrangian is invariant under time translations and Noether's Theorem can be used to derive a non-trivial and exact conserved current for energy. The only thing that makes general relativity a little different from electromagnetism is that the time translation symmetry is part of a larger gauge symmetry so time is not absolute and can be chosen in many ways. However there is no problem with the derivation of conserved energy with respect to any given choice of time translation.
There is a long and interesting history to this problem. Einstein gave a valid formula for the energy in the gravitational field shortly after publishing general relativity. The mathematicians Hilbert and Klein did not like the coordinate dependence in Einstein's formulation and claimed it reduced to a trivial identity. They enlisted Noether to work out a general formalism for conservation laws and claimed that her work supported their view.
The debate continued for many years especially in the context of gravitational waves which some people claimed did not exist. They thought that the linearised solutions for gravitational waves were equivalent to flat space via co-ordinate transformations and that they carried no energy. At one point even Einstein doubted his own formalism, but later he returned to his original view that energy conservation holds up. The issue was finally resolved when exact non-linear gravitational wave solutions were found and it was shown that they do carry energy. Since then this has even been verified empirically to very high precision with the observation of the slowing down of binary pulsars in exact agreement with the predicted radiation of gravitational energy from the system.
The formula for energy in general relativity is usually given in terms of pseudo tensors such as those proposed by Laundau & Lifshitz, Dirac, Weinberg or Einstein himself. Wikipedia has a good article on these and how they confirm energy conservation. Although pseudotensors are mathematically rigorous objects which can be understood as sections of jet bundles, some people don't like their apparent co-ordinate dependence. There are other covariant approaches such as the Komar Superpotential or a more general formula of mine which gives the energy current in terms of the time translation vector $k^{\mu}$ as
$ J^{\mu}_G = \frac{1}{16\pi G} (k^{\mu}R - 2k^{\mu}\Lambda - 2{{k^{\alpha}}_{;\alpha}}^{\mu} + {{k^{\alpha}}_{;}}^{\mu}_{\alpha}+ {{k^{\mu}}_{;}}^{\alpha}_{\alpha})$
Despite these general formulations of energy conservation in general relativity there are some cosmologists who still take the view that energy conservation is only approximate or that it only works in special cases or that it reduces to a trivial identity. In each case these claims can be refuted either by studying the formulations I have referenced or by comparing the arguments given by these cosmologists with analogous situations in other gauge theories where conservation laws are accepted and follow analogous rules.
One area of particular contention is energy conservation in a homogeneous cosmology with cosmic radiation and a cosmological constant. Despite all the contrary claims, a valid formula for energy conservation in this case can be derived from the general methods and is given by this equation.
$ E = Mc^2 + \frac{\Gamma}{a} + \frac{\Lambda c^2}{\kappa}a^3 - \frac{3}{\kappa}\dot{a}^2a - Ka = 0$
$a(t)$ is the universal expansion factor as a funcrtion of time normalised to 1 at the current epoch.
$E$ is the total energy in an expanding region of volume $a(t)^3$. This always comes to zero in a perfectly homogeneous cosmology.
$M$ is the total mass of matter in the region
$c$ is the speed of light
$\Gamma$ is the density of cosmic radiation normalised to the current epoch
$\Lambda$ is the cosmological constant, thought to be positive.
$\kappa$ is the gravitational coupling constant
$K$ is a constant that is positive for spherical closed space, negative for hyperbolic space and zero for flat space.
The first two terms describe the energy in matter and radiation with the matter energy not changing and the radiation decreasing as the universe expands. Both are positive.
The third term is "dark energy" which is currently though to be positive and contributing about 75% of the non-gravitational energy, but this increases with time.
The final two terms represent the gravitational energy which is negative to balance the other terms.
This equation holds as a consequence of the well-known Friedmann cosmological equations, that come from the Einstein field equations, so it is in no sense trivial as some people have claimed it must be.