Middlesbrough were drawn against Austrian side Graz AK in the last 32 of the Uefa Cup.
Boro will be the third UK side to play Graz AK, who were ousted by Liverpool from the Champions League but finished above Rangers in the Uefa group stage.
Newcastle were handed a tie against Dutch side Heerenveen.
Both English sides were drawn away for the first leg of ties, to be played on 16/17 February, with the return matches taking place on 24 February.
Both Middlesbrough and Newcastle won their respective groups and were guaranteed to avoid clubs who qualified in the top two of their group and those coming into the competition from the Champions League.
Other ties in the draw were Ajax against Auxerre and holders Valencia against Steaua Bucharest.
Sporting Lisbon, who drew with Newcastle on Thursday, were handed a clash with Feyenoord while Olympiakos - knocked out of the Champions League by Liverpool -
will face Sochaux.
The draw for the last 16 was also made, with Middlesbrough handed a potential tie against the winners of the Sporting Lisbon or Feyenoord tie.
Keith Lamb, Middlesbrough's chief executive, said: "It will be a difficult game for us but we will be ready for it.
"We would play either Sporting Lisbon or Feyenoord if we get through - I'm sure the three Dutch players would be hoping it is Feyenoord - especially George
Boateng who used to play for them - but first of all we have to get past Graz and it will not be easy."
Newcastle were given the possibility of a game against Olympiakos or Sochaux.
Russell Cushing, Newcastle's chief operating officer, said: "We were disappointed last year when we didn't quite make the final and that has given the players a lot of determination to go one better.
"We do have a good feeling about this competition, but we will not underestimate Heerenveen. Easy games can become very difficult, every game in this competition becomes a challenge."
Heerenveen director Henk Hoekstra said: "Newcastle are the favourites of course because the Premier League is much stronger than the Dutch league but we
have a good young side and this is an opportunity to make a name for themselves.
Draw for the Uefa Cup first and second knockout rounds :
Graz AK (Austria) v Middlesbrough (England)
Heerenveen (Netherlands) v Newcastle United (England)
Basel (Switzerland) v Lille (France)
Parma (Italy) v VfB Stuttgart (Germany)
Sporting Lisbon (Portugal) v Feyenoord (Netherlands)
Alemannia Aachen (Germany) v AZ Alkmaar (Netherlands)
Austria Vienna (Austria) v Athletic Bilbao (Spain)
Partizan Belgrade (Serbia & Montenegro) v Dnipro
Valencia (Spain) v Steaua Bucharest (Romania)
Ajax Amsterdam (Netherlands) v AJ Auxerre (France)
CSKA Moscow (Russia) v Benfica (Portugal)
Fenerbahce (Turkey) v Real Zaragoza (Spain)
Panathinaikos (Greece) v Sevilla (Spain)
Shakhtar Donetsk (Ukraine) v Schalke 04 (Germany)
Olympiakos Piraeus (Greece) v Sochaux (France)
Dynamo Kiev (Ukraine) v Villarreal (Spain)
First leg - 16-17 February
Second leg - 24 February
Liebherr Gak/Middlesbrough v Sporting/Feyenoord
Panathinaikos/Sevilla v Parma/Vfb Stuttgart
Valencia/Steaua Bucuresti v Dynamo Kiev/Villarreal
Basel/Lille v Ajax/Auxerre
Olympiakos/Sochaux v Heerenveen/Newcastle
Shakhtar Donetsk/Schalke 04 v Alemannia Aachen/AZ
Partizan Belgrade/Dnipro v CSKA Moscow/Benfica
Austria Vienna/Athletic Bilbao v Fenerbahce/Real Zaragoza
First leg - 10 March
Second leg - 16-17 March