Manager Nathan Jones' half-time introduction of top scorer James Collins and Cornick changed the game, with Collins nodding in the first before Elijah Adebayo levelled and Cornick grabbed the most deserved goal of the season in the space of 15 second-half minutes.
The second-half flip, mirroring what happened in the home game against Sheffield Wednesday in February, and similar to the win at Wycombe in the last away game when the Hatters were one down at the break, lifted Town up to 11th in the Championship table.
Jones named an unchanged line-up from the 0-0 draw against Reading on Wednesday night, including Ryan Tunnicliffe, who was drafted in last minute after Luke Berry sustained an injury in the warm-up for that game.
Kazenga LuaLua started for the third match in a row, joined on the opposite flank by Jordan Clark, providing attacking support to lone striker Elijah Adebayo.
The Hatters had the game's first attempt on goal in the fifth minute, Adebayo driving past his man on the left side of the penalty box and hitting a left-footer that flew narrowly over Daniel Bentley's bar.
Referee John Busby deemed it had taken a deflection of the sliding defender's leg, and from the resulting corner the Hatters had the ball in the net, Kiernan Dewsbury-Hall's inswinger going over Bentley, but again the official had the final say, penalising Ryan Tunnicliffe for impeding the keeper on the goal-line when there appeared little contact.
City had the next attempt, Nahki Wells firing wide with 20 minutes on the clock, then Simon Sluga had to be quick off his line to fend off an attempted lob from the same player who had raced on to a lofted ball over the top, the Croatian keeper saving with his face and ref Busby waving away the hosts' appeals for a penalty.
Clark was soon stretching the City defence at the other end, taking a pass from James Bree inside the area and turning his man, only to see his shot flash across the face of goal and inches wide of the far post.
It was the Robins who took the lead just after the half-hour, however, when Adam Nagy drove forward from halfway and fed Wells to the right of the Town penalty area, with the former Huddersfield and Burnley striker firing across Sluga into the bottom corner.
It was two in the 38th minute when Nagy followed up after Sluga had initially saved Wells' header, the midfielder squeezing the ball under the Town keeper from a tight angle to double the City advantage.
The Hatters tried to hit back before the break, and Clark forced Bentley into a reaction save in injury time as Bree's volley into the ground from Naismith's deep cross found the wideman's head on the edge of the six-yard box.
Jones made his two changes at half-time, bringing on Collins for LuaLua and Cornick for Tunnicliffe, and it almost brought an immediate response, Collins having two headers at goal in the 48th minute.
The first, from a Cornick long throw on the right, saw Bentley push the ball towards Adebayo, who stabbed it back across the face of goal but Tomas Kalas managed to clear before Collins could finish.
The second, this time from a Cornick cross from the same flank, found Collins rising above Kalas but unable to keep his header down.
Town had started the half on the front foot, but City striker Tommy Conway fired a warning shot across the face of Sluga's goal before Collins made it third time lucky with a header that halved the deficit in the 59th minute.
Dewsbury-Hall whipped a corner in from the right and Collins stole a march on his marker to get to the near post and turn the ball past Bentley with the faintest of flicks for league goal number ten of the season, 13th in total including his Carabao Cup hat-trick against Norwich on the opening day.
The Town were on level terms in the 68th minute, Dewsbury-Hall again the architect with a left-wing cross into Adebayo, who opened the face of his right boot to steer his effort in off the far post from 12 yards.
It was the striker's fifth goal since signing in January from Walsall, where he had already netted ten times in League Two this term, making it 15 in total.
Things were to get even better on 74 minutes when Cornick, having gone the entire campaign without netting the goal his performances have deserved, had the ball land at his feet from Dewsbury-Hall's mis-hit shot in the middle of the penalty area.
The striker span and hit it left footed past Bentley and was joined in celebration by the whole team, bar Sluga, who knew exactly what it meant to the former Bournemouth man!
Conway thought he had dragged City back level in the 88th minute, but the flag was up for offside and the Town ran out winners once again by the odd goal in five!
Town: Sluga; Bree, Pearson, Bradley (C), Naismith; Mpanzu, Tunnicliffe (Cornick 46), Dewsbury-Hall; Clark (Potts 86), LuaLua (Collins 46); Adebayo (Rea 86).
Substitutes: Shea, Cranie, Potts, Cornick, Moncur, Rea, Collins, Nombe, Morrell.
Goals: Collins 59, Adebayo 68, Cornick 74
Bristol City: Bentley; Sessegnon, Vyner, Kalas (C), Rowe (Hunt 71); Lansbury (Scott 71), Bakinson (Janneh 86), Massengo, Nagy (Baker 71), Conway; Wells (Semenyo 70).
Substitutes: O’Leary, Hunt, Mariappa, Baker, Scott, Palmer, Pearson, Semenyo, Janneh
Goals: Wells 31, Naby 38
Referee: John Busby