Petroleum hydrocarbons, as aggressive components of diesel oils, after migration to the land environment can alter the activity and efficiency of ecosystems. They can also be dangerous to animal and human health. Eco-friendly methods for the reclamation of affected soils is necessary to manage degraded lands. One such method is the use of ashes. The aim of this research was to determine how soil pollution with diesel oil (brand name, Eco-Diesel) affects the chemical composition of maize (Zea mays L.) and whether the application of ash from a combined heat and power plant, as well as from sewage sludge incineration, could reduce the potentially adverse impact of diesel oil on plants. The research results demonstrated that soil contamination with Eco-Diesel oil modified the content of selected macronutrients in the analyzed crop plant. Eco-Diesel oil had a negative effect on maize yield. The highest diesel oil dose in a series without neutralizing substances had a positive effect on the accumulation of most elements, except nitrogen and sodium. Soil enrichment with ash differentiated the content of macronutrients, mainly nitrogen and phosphorus, in the aerial biomass of maize. The ashes increased the yield of maize and content of some macronutrients, mainly nitrogen but also calcium, the latter in a series where soil was treated with ash from sewage sludge thermal recycling. Both types of ash also resulted in a decrease in the plant content of phosphorus, while ash from hard coal caused a slight reduction in the content of potassium in maize. Ash of different origins can be an effective solution in the reclamation of degraded soils, which may then be used for growing energy crops.