The Poland international, on loan from Groclin, struck towards the end of the first period of extra time for the four-time winners of the League Cup.
In normal time, Luke Chambers cancelled out Adam Johnson's opening goal for the visitors.
Boro, whose triumph in this competition in 2004 remains the club's only major trophy in its 133-year history, created the better early chances.
Paul Smith produced a good early save to keep out Jeremie Aliadiere's low shot before Julio Arca's follow-up was deflected wide.
Johnson worked Smith again with a shot from the right side of the box and Aliadiere outfoxed two defenders on the opposite side but dragged his shot into the side-netting.
Forest's first chance arrived after half an hour when Dexter Blackstock and Robert Earnshaw combined but the latter drilled his shot wide.
Johnson scored two minutes before the break to hand Boro a deserved lead.
Marvin Emnes played Johnson in on the left side of the box and the England Under-21 international beat Smith at the near post. The Forest keeper will feel he should have done better.
Aliadiere could have extended Boro's lead at the start of the second half but blazed his shot high and wide.
It proved to be a costly miss as Chambers equalised after an hour.
The defender turned Majewski's corner into the net with a brilliant piece of improvisation beating Danny Coyne with a deft backheel.
Leroy Lita almost got on the end of a teasing Johnson cross midway through the second half but the ball skidded off the greasy surface and just beyond his outstretched leg.
Lita had another chance to win it in the fifth of six added minutes at the end of normal time as the visitors broke on the counter-attack but a Forest defender managed to get back and save the day with a superb block.
Forest created the better chances in extra time. Dele Adebola and Blackstock went close with headers in the first period.
Majewski then steered Adebola's cross in at the near post in the 103rd minute.
Only a superb save from Coyne denied the Pole another goal at the start of the second period.
Boro pressed for an equaliser but the closest they came was a shot from Arca that bobbled just wide.