Cardiff boss Neil Harris felt his side rode their luck to finish 1-0 winners at Luton.
The Hatters had three good chances in the opening period but could not take them, with Lee Tomlin making them pay in the 73rd minute, netting the only goal of the game with his seventh of the season.
Victory took City four points from the play-offs in the Championship and Harris said: "It's a huge week, us playing three teams in the lower reaches of the division and we just thought today was a game we had to try and win if we're serious about being in the top six.
"The game was vital to us to pick some points up. We started the game really well, but were sloppy with the ball, which caused us a few problems on the counter attack and I thought we were lucky not to be behind at half time.
"Second half was so much better, a lot more professional and some real moments of quality as well.
"It looked like the only thing we were missing today was that end product in the box, but then Lee Tomlin, time and time again since I've been here, has got that moment.
"We spent all day yesterday and this morning talking about if we want to be serious contenders for the top six then at some stage you do have to put a little run together, so it's just making sure you're consistent over the course of that 90 minutes."
Town had enjoyed the better of the first period, with Ryan Tunnicliffe crossing rather than shooting, Harry Cornick dragging a one-on-one wide and Pelly-Ruddock Mpanzu lashing off target.
After the break, City full back Joe Bennett saw his dipping corner tipped away by home keeper Simon Sluga, who then made a superb save to deny Callum Paterson when clean through.
He was beaten moments later in the 73rd minute, Tomlin finding space on the edge of the box and curling a drive into the bottom corner for his seventh goal of the campaign.
James Collins headed wide before missing his kick when visiting keeper Alex Smithies fumbled George Moncur's long range shot in stoppage time.
Town boss Graeme Jones said: "We set up with the diamond and we out-possessed them, we created more chances than them, we had more shots on target than them, the boys gave absolutely everything they've got.
"The game boils down to two moments, where Tomlin, he doesn't hope to score, he makes sure he can score, while we had a really good opportunity with Tunni (Ryan Tunnicliffe), an incredible one on one with Harry, and Collo's header.
"You have to take them if you're going to win the game and we didn't, that was the difference.
"If you analyse the performance then I've got no complaints.
"We lost the game, with the opportunities we have that we didn't take and the one opportunity they had was in the back of the net."