Tries from Hamish Watson and Tim Visser - in his last appearance for Edinburgh - combined with Sam Hidalgo-Clyne's boot to give the hosts a 23-22 lead late on, after Noel Reid, Jack Conan and Zane Kirchner's scores had earlier given Leinster control.
And while their fifth-placed finish in the GUINNESS PRO12 table was a disappointing return for last year's champions, Madigan insists the performance bodes well for the future.
"It was a really tough game as Edinburgh really put it up to us with them fighting for European qualification," the Ireland fly-half said.
"It was very important for us to end on a high as we did lose our way a bit in the league during the Six Nations.
"But this game showed that the team has full belief in our head coach Matt O'Connor.
"When we stick to his game plan then we are a very capable side, and it was great to score more than four tries as well here."
Follow us on Facebook, join the conversation on Twitter, sign up to our YouTube channel for extensive match highlights and sign up for our newsletter for regular updates on the GUINNESS PRO12