Leckie gave Ingolstadt the lead in the 16th minute, but Charles Aranguiz and Kevin Kampl turned the game back in Leverkusen's favour before half-time.
Stefan Kiessling added a third on the hour mark before Ingolstadt's top scorer Moritz Hartmann added a second from the penalty spot.
The Bavarians could not find an equaliser, but after their coach Ralph Hasenhuttl's last game in charge before he joins Leipzig next season, they were nevertheless able to celebrate the best season in their history, with an 11th-placed finish in the Bundesliga.
Leverkusen were already sure of finishing third, which brings with it a place in next season's UEFA Champions League group phase.