Collin Quaner's last-gasp strike earned 10-man Ipswich a morale-boosting 3-2 win over Leeds, who head into the play-offs in dire form.
Marcelo Bielsa's side go into the first game of a two-legged tie with Derby having thrown away automatic promotion after successive defeats to Wigan and Brentford were followed by a draw against Aston Villa and the latest setback in Suffolk.
Town midfielder Downes found himself with just goalkeeper Kiko Casilla to beat in the 19th minute following tidy link-up play with Quaner and Alan Judge, but his goal-bound effort was deflected for a corner.
In the 28th minute, Ipswich striker Quaner collected a slide-rule pass from Dozzell only to be fouled outside the area by Casilla. But from the resulting free-kick by Judge the home side took the lead through Downes after the ball fell to him in the six-yard box.
However, Ipswich regained the lead with a superb strike two minutes into the second half. Neat one-two touches in midfield between Trevoh Chalobah and Quaner fed Dozzell and he fired home from just inside the penalty area.
A great double save from the Ipswich goalkeeper from attempts by Klich and Hernandez kept the visitors at bay.
But they did draw level after 76 minutes following another fine cross by Ayling. He found Roofe whose shot hit the crossbar and bounced down, struck Dallas and the ball ended up in the net.
Leeds were then awarded a penalty in the 80th minute when Chambers was adjudged to have fouled Roofe.
The Ipswich captain was shown a straight red card as Roofe prepared to take the penalty but he fired high over the crossbar, much to the delight of the Ipswich fans.
Ipswich then won the game in bizarre fashion following a mix-up between Ayling and Casilla, with Quaner pouncing to fire the ball into an empty net.