Hugo Viana's strike gave Braga a win which leaves Birmingham's Europa League fate out of their own hands.
Blues started well and had the chance to lead but Nikola Zigic's penalty was saved after Ewerton fouled Wade Elliot.
Braga defender Ewerton should have been sent off for a second booking but stayed on and Viana then saw his long-range shot go in off Curtis Davies.
Birmingham now need to beat Maribor in their last group game in December to have any chance of progressing.
Braga are through and will be joined in the last 32 by Club Brugge if the two sides play out a draw in their final fixture in Belgium.
Did you know?
Nikola Zigic has scored just twice for Birmingham since his goal in last season's Carling Cup final
But should Braga win and Birmingham triumph over Maribor, Chris Hughton's side will qualify as a result of their superior head-to-head record over Brugge.
The Belgian side looked set for an exit as they trailed Maribor 3-0 but pulled off a remarkable comeback to score four times in the final 16 minutes to win 4-3.
Birmingham face Championship trips to play-off rivals Cardiff and Hull next week but Hughton named a strong side in Portugal and was rewarded with a superb opening quarter against last season's Europa League finalists.
Blues attacked from the off and could have had a penalty in the first minute when Chris Burke's cross struck the hand of Elderson inside the area.
Referee Markus Strombergsson waved play on but did award a spot-kick 10 minutes later when Ewerton was caught in possession by Elliott and then clumsily hauled him down.
The defender was booked but Zigic wasted the chance when his tame effort was easily stopped by Quim's sprawling save.
Ewerton then should have been sent off minutes later when he slid in rashly to bring down Burke on the edge of the area but he was somehow spared a second yellow card.
Steven Caldwell then saw a header saved by Quim as Birmingham piled on the pressure but eventually the hosts wrestled back control of the game and, with captain Alan influential after moving from the right flank to the left, began to look dangerous.
This season's Europa League final will be held in Bucharest
Midfielder Mossoro looped a 25-yard effort wide and then slalomed through two tackles to break into the area, only to be denied by a fine covering challenge from Keith Fahey.
Birmingham started the second period well but fell behind to a cruel deflected strike from former Newcastle man Viana.
The midfielder collected a ball from the right 30 yards from goal and saw his hopeful low shot strike Davies to deflect past a wrong-footed Boaz Myhill and into the bottom corner.
Zigic headed over a David Murphy cross as Birmingham rallied but the hosts should have sealed the win in the last few minutes.
Lima was sent free by a long ball and after Myhill made a strong save, substitute Paulo Cesar blazed the rebound over the top.
Hughton will now turn his attention towards moving into the the top six in the Championship but Blues could yet extend their European exploits beyond Christmas with victory over Maribor on 15 December.
- 01 Quim
- 05 Ewerton Booked
- 20 Echiejile (Douglao - 68' )
- 08 Mossoro (Merida - 84' )
- 22 Djamal
- 25 Leandro Salino
- 26 Vinicius
- 45 Viana
- 10 Barbosa (Paulo Cesar - 68' )
- 18 Lima
- 30 Alan Booked
- 32 Berni
- 02 Rodrigo Galo
- 44 Douglao
- 17 Merida
- 48 Nuninho
- 09 Paulo Cesar
- 21 Nuno Gomes
- 01 Myhill
- 03 Murphy
- 04 Caldwell Booked
- 23 Spector
- 24 Davies
- 07 Burke Booked
- 08 N'daw
- 11 Beausejour (Redmond - 64' )
- 15 Elliott (King - 64' )
- 18 Fahey
- 19 Zigic (Wood - 76' )
- 13 Doyle
- 05 Pablo
- 14 Gomis
- 22 Redmond
- 09 King
- 17 Rooney
- 39 Wood