Grant Leadbitter struck twice for Town as the honours were shared in a pulsating encounter at Portman Road.
The midfielder put Blues in front inside the first six minutes when his shot was deflected in by Tony McMahon.
Boro went in at the break with the advantage though, goals from Andy Halliday and Scott McDonald in the space of two minutes stunning Paul Jewell's side.
Andrew Taylor made it three for Tony Mowbray's team six minutes into the second-half before the comeback began with Connor Wickham heading home just past the hour and then Leadbitter levelled for Blues from the penalty spot after Lee Martin had been brought down in the box.
Town stayed with the same side that beat Crystal Palace at the weekend and Blues' matchwinner from that game, Josh Carson, was immediately in the action, his cross just evading Jason Scotland at the far post.
Carson then had a header cleared off the line before Town were ahead, Leadbitter's shot on six minutes taking a big deflection to leave Paul Smith with no chance.
Jimmy Bullard sent a free-kick just over as Town dominated the early exchanges, with Boro forced into an early change with the injured Merouane Zemmama replaced by Halliday.
A second substitution followed midway through the half with Seb Hines, who received lengthy treatment after a clash of heads with team-mate Joe Bennett, making way for Rhys Williams.
Matt Bates had a header cleared in a rare chance for the visitors in the opening half hour, while at the other end Wickham and Scotland both had efforts deflected.
Smith saved well from David Norris' header, Wickham unable to convert the rebound as Town threatened a second before the game changed in the space of two minutes before the break.
Halliday levelled the scores after Delaney had slashed a cross against the bar on 41 minutes, then McDonald was on hand soon after to convert from close range after Halliday had set him up.
Blues could have been level before the half-time whistle though, Scotland diverting Jimmy Bullard's shot just wide.
A mix up at the back almost let in McDonald inside the opening moments of the second-half, McDonald's effort cleared off the line by Gareth McAuley.
Bullard's superb delivery from a free-kick out wide was missed by a pack of players before Boro stung Town again six minutes into the second-half,
Wickham lost possession, the Teesiders worked the ball out to Taylor whose arrowed a shot past Lee-Barrett into the far corner.
Town had the ball in the net soon after, Bullard's effort palmed out by Smith before Wickham buried the rebound but not before the offside flag was raised.
Lee-Barrett prevented a fourth with his feet from Bennett, Town making a first change with Martin on for Scotland just before the hour.
Mark Kennedy picked up the first yellow card of the game for a foul on Tarmo Kink, Wickham thundering a left foot effort just over.
The England U21 international made no mistake on 63 minutes though, climbing high to head in Bullard's free-kick from six yards to pull Town back in the game.
It needed smart reflexes from Smith to deny Wickham from Carlos Edwards' header, the 'keeper then holding firm from Leadbitter's effort from the edge of the box.
Lee-Barrett's right hand just did enough to stop Bennett from adding to the scoreline, Kink replaced by Kevin Thomson for the last 20 minutes.
Town's levelled the scores on 75 minutes, Leadbitter sending Smith the wrong way from the spot after Martin had been brought down by former Blues' loanee Bates.
Wickham almost made it four within a minute, Smith saving from close range, the 'keeper doing even better to keep out Delaney's header from point blank range.
Darren O'Dea replaced Kennedy for the final five minutes, immediately cutting out the danger from a Julio Arca led break.
Bullard fizzed a free-kick that Smith managed to beat out as the game entered added on time, Boro going close at the other end with a Taylor cross that went just wide before referee Mick Russell brought the entertainment to an end.
Town: Lee-Barrett, Edwards, McAuley, Delaney, Kennedy (O'Dea 85), Leadbitter, Norris, Bullard, Wickham, Scotland (Martin 58), Carson. Subs not used: Fulop, Peters, Drury, Healy, Civelli. Booked: Kennedy.
Middlesbrough: Smith, McMahon, Hines (Williams 34), McManus, Bennett, Kink (Thomson 72), Bates, Arca, Taylor, Zemmama (Halliday 15), McDonald. Subs not used: Coyne, Davies, Smallwood, Tavares.