Oops completely misread the question, non-chemical energy pathways for an animal living in close contact with a magmatic system or erupted lava. Okay first things first lava is easier, it's in contact with the carbon, water, oxygen, and nitrogen rich space we call the atmosphere, these elements are available in magma but they're harder to get at because they're dissolved or chemically bound into rock minerals. Also an external atmosphere makes thermal regulation easier too, that's going to be important. For sourcing the energy I'd start with the thermocouple, they use a "sandwich" of metal foils to create electron flow when in a thermal gradient. We use them mainly to measure temperature but they can be used on a larger scale to produce electrical currents from concentrated heat sources. In this situation thermal regulation is very important because the animals' core is going to have to be cooler than the outside environment or the thermal gradient disappears and the thermocouple stops generating energy.
In practice the animal will have a finely layered metallic skin of sorts that simultaneously generates free electrons for metabolic processes and protects them from a lot of direct heat transfer from the external environment. In normal, read carbon-based, systems free electrons are rare, we use ions that "swap" electrons instead. The actual chemical reactions for the creature I propose would be similar to those we see in carbon-based lifeforms, using the same basic structures of proteins and carbohydrates (but not the same carbohydrates and proteins because they aren't thermal stable at these temperatures) but instead of using direct ion exchanges they'd utilise a lot more direct elemental oxidation to source raw chemicals for protein synthesis and ionic reduction to source chemical elements for the thermocouple skin and other structural elements.
Effectively they're using electricity and adsorbed chemical building blocks to create energy storage structures (carbohydrates) and cellular structural members (proteins), technically they're not animals, they're really weird plants, primary producers, not consumers.
Couple of note on environment issues; if you are using the low temperature Carbonatite magma/lava systems then atmospheric material is less important to the life-systems chemistry due to the relative abundance of those elements in the magmatic material. If you use a traditional skeletal chemistry in non-Carbonatite systems Calcium is going to be a bottleneck element limiting populations as it's relatively unavailable.
Right hopefully that's clear-ish, drop me a comment if you want to know more about some element of what I've laid out.