Carlisle were looking to get back to winning ways following the weekend trip to Exeter and they were up against a high-flying Newport County outfit who had established a five-point gap at the head of the division.
And manager Chris Beech was forced to make a change for the first time in five games as he was without the suspended Gime Toure, who had received a red card against the Grecians during the second half of the weekend fixture.
Striker Gav Reilly got the nod, with the remainder of the team unchanged.
A volley from Brandon Cooper swirled into the Warwick as Newport kicked off in confident mood, but United were quickly in their stride as Callum Guy won a free kick. He sent it deep but Hayden couldn't quite get there.
Another Guy free kick found interest from McDonald and Hayden, but it looped high and fell kindly for Townsend to gather.
The hosts almost picked the lock when a dummy from Kayode left Reilly in possession. His reverse pass sent Kayode on a run and he had Alessandra on the overlap as he surged into the box. The pass had slightly too much on it and the forward was pushed wide.
Carlisle came again with a patient build-up to put the back line under pressure. Mellish showed strength to beat the keeper and Haynes to the ball, but he had his back to goal and he couldn't find room for a shot.
The bright start was rewarded on 14 minutes when Kayode latched on to a superb 50-yard through ball from Anderton. His first touch brought Haynes close, and the referee had no hesitation in pointing to the spot as the pair tumbled to the floor.
Lewis Alessandra made it three for the season as he squeezed a powerful penalty past Townsend, who got his fingertips to it.
United had their tails up and they twice had good moments in the box as attempts from Tanner, Reilly and Riley were blocked. The visiting defence looked uncomfortable as they came under pressure, but they were able to clear their lines when a near post set piece was guided wide by Mellish.
Keeper Paul Farman had work to do midway through the half when Labadie muscled his way onto the ball 30-yards out. He kept his drive low and it needed a firm hand and full length dive from the stopper.
A training ground routine followed as the ball was arrowed firmly at Dolan from the corner. The volley was crisp but Hayden put himself in the way to guide it to safety.
The Cumbrians worked hard to dominate the midfield, and they kept a strong attack at arm's length for much of the half.
And they were a whisker away from doubling the lead on 40 minutes when Gav Reilly shielded the ball under pressure. He had two to contend with, but he bustled his way forward before shooting low. He was disappointed to see it ricochet off the base of the upright.
More excellent approach play saw Kayode pull wide. He looked up and spotted Riley on the edge of the box, and his snapshot had Townsend beaten all ends up. The ball dipped a fraction too late and it brushed the roof of the net.
Riley tried his luck again when Alessandra took over as the Blues broke from deep. Kayode was involved, but it was the midfielder who was in another good position. He dropped a shoulder and lost his man but a grasscutter hit Cooper and deflected behind.
The lead should have been doubled in time added on when Alessandra slid a perfect ball through for Reilly. He had just Townsend to beat, and he gathered his thoughts before letting fly with his left boot. The effort was scuffed and it skipped agonisingly wide.
Newport sent men forward at the start of the second half and a run of set piece deliveries had to be dealt with. Dolan and Proctor fed balls in, but Farman was well protected, and Devitt rattled one wide at the end of what had been a good spell.
Kayode put one right at Townsend as he used a run from Tanner to cause confusion, and Reilly earned a corner when he made space for Guy to pick him out. The effort hit a defender and the moment was gone.
McDonald did well at the other end to get there first with a clearing header when Dolan tried to pick out Amond, but Sheehan was wayward when the corner came his way. His volley on the full rose high off his boot.
Mellish started and almost finished a move with an hour on the clock when he broke from defence having intercepted a pass. He was there to take the shot on as it came into the box but it was on his right boot and he couldn't find the touch.
But there was much better to come from Mellish as he had just one thing on his mind when the ball was rolled into his path, as he found acres of space following a fantastic run from Patrick. He put his foot through it and Townsend quite simply couldn't get anywhere near it as it rifled into the top corner.
Nick Anderton hit the post as he whistled a beauty through a ruck of bodies, with the home side once again on the up, and Patrick picked out Tanner after he'd shaken off a tackle. The defender aimed low but a deflection sent it past the upright.
Carlisle thought they'd put the icing on the cake with a late break which saw Patrick keep his head as Alessandra got involved. The substitute measured it for Mellish, and his eighth goal of the season was never in doubt as he clipped it into the roof of the net - this time with a clean scoop from his right boot.
But former-Blue Jamie Devitt gave his side late hope when a cross from Ellison was nodded towards the back stick from Proctor. It fell nicely and Farman could do nothing as it was rattled into his net.
The sides exchanged chances through what became a frantic finish, with Patrick and Alessandra having half sights for the Blues.
Another favourable break of the ball in the Carlisle box saw Josh Sheehan pull another goal back deep into time added on, but the hosts could have had the last say when substitute Micah Obiero was sent through with just seconds on the clock.
He drew the keeper, but he lost his balance and his shot lacked power.
Carlisle United - Alessandra (15 pen), Mellish (68, 81)
Newport County - Devitt (84), Sheehan (90)
Carlisle United - McDonald (48)
Newport County - Labadie (23)
Carlisle United - Farman, Tanner, Hayden, McDonald, Anderton (c), Riley (Furman 90), Guy, Mellish, Alessandra, Reilly (Patrick 66), Kayode (Obiero 90). Subs - Dewhurst (gk), Hunt, Charters, Malley.
Newport County - Townsend, Haynes (Ellison 70), Labadie (c) (Devitt 28), Cooper, Willmott, Dolan, Amond, Sheehan, Abrahams (Proctor 46), Bennett, Demetriou. Subs - King (gk), Baker, Twine, Lewis.
Referee - Seb Stockbridge
Assistant Referee 1 - Paul Newhouse
Assistant Referee 2 - Geoffrey Liddle
Fourth Official - Andrew Miller
Attendance - BCD