Luka Modric's late winner saw Real Madrid beat a gutsy Granada side 2-1 in La Liga on Sunday evening to keep pace with the top two.