Before Leicester's first match since the helicopter crash at their stadium a week ago, in which their chairman Vichai Srivaddhanaprabha and four others died, a moving minute's silence was held at Cardiff City Stadium.
Leicester goalkeeper Kasper Schmeichel, who shed tears during the silence, saved early on from Bobby Reid.
Cardiff went close again when Victor Camarasa’s free-kick hit the crossbar on the half-hour.
However, Leicester broke the deadlock on 55 minutes when Ben Chilwell’s cross was finished first-time by Gray.
James Maddison and Jamie Vardy went close to doubling the lead but were kept out.
A first win in four lifts Leicester up to 10th, while Cardiff fall into the relegation zone on five points.
Cardiff City: 10 Nov v Brighton (H)
Leicester City: 10 Nov v Burnley (H)