An own goal from Federico Fernandez and a 49th minute's strike from Shinji Okazaki gave interim manager, Michael Appleton his first league victory despite a consolation from Alfie Mawson.
Shakespeare was sacked after a single win in eight matches in the English topflight this season.
And the 26-year-old who acknowledged the ‘surprise’ sack of the gaffer has dedicated the triumph to the Englishman.
“Of course (the win is for Shakespeare). He was our manager and everyone loved him at the club,” Mahrez told Leicester Mercury.
“It was a surprise for us. But we have to try to honour the club because the most important thing is the club. We played good today and we deserved to win.
“It was a difficult week for us as everyone knows.
“It was good that we won today, it was an important game for us and for the club. I think we put everything on the side and we played our game and we got the three points.”
Leicester are 14th on the log with nine points and will look to continue with this impressive form when they clash with Leeds in the League cup on Tuesday.