Mechanical licenses are usually distributed by a label, though, and Gaga and Madonna are both on Interscope.
I don't know how much control Gaga has over her contract, but it's very possible that it says she has to give free mechanical licenses to other artists on her label, so it's possible Madonna didn't need permission for it, but Gaga will still be paid royalties for performances of the song.
