Saints must have thought they had the game won when Michael Higdon grabbed the opener on a day when both sides passed up decent chances.
But United netted twice in the last seven minutes through Danny Swanson and Goodwillie to claim a dramatic last-gasp victory in Paisley.
Dundee United were handed a boost ahead of the match when Garry Kenneth was named in the starting line-up. He was expected to be sidelined with a knee injury but was able to shore up a depleted United defence at new St Mirren Park.
The Tangerines made just one change following their midweek defeat to Hamilton, with David Robertson drafted into the side and Goodwillie dropped to the bench.
Saints made two changes after drawing with St Johnstone; Steven Thomson and Steven Robb were back in the team, with Chris Innes injured and Stephen O’Donnell among the substitutes.
The last meeting between the two clubs here ended in a drab goalless draw and the opening spell of this game suggested another closely-fought affair could be on the cards.
Chances were few and far between early on before Prince Buaben tried his luck with a ferocious shot from distance which fizzed just past Paul Gallacher’s right-hand post.
At the other end, Andy Dorman tested Dusan Pernis from close range before the danger was cleared by Darren Dods. John Potter then saw his header from a corner tipped over by the United keeper as Saints pressed for the opener.
Last-gasp defending from the home side prevented United from opening the scoring when a netbound header from Jon Daly was hooked off the line by an alert Jack Ross.
Saints then squandered a great chance of their own when Robb raced past Pavel Mihadjuks before cutting back for Billy Mehmet to stab inches wide of target.
Mihadjuks – who had already been booked – was having a torrid time at right-back and was hooked in favour of Ross Smith after just 33 minutes, with the youngster making his senior debut.
With half-time approaching, the home fans screamed for a penalty when Hugh Murray went to ground under pressure from Kenneth but there appeared little in the incident and there was no penalty from referee Euan Norris.
With just under an hour gone Saints introduced Craig Dargo and United threw Goodwillie into the action.
United passed up another chance when Sean Dillon delivered a great ball into the box and Daly just failed to connect before Swanson blasted wide.
The breakthrough came after 66 minutes when Saints stormed into the lead. Dods fouled Dargo and Robb stepped up for the free kick. He picked out Higdon at the back post and he sent a looping header past Pernis.
The Tannadice side thought they were back on level terms when Daly nodded into the back of the net but the referee had already blown for a Dods foul.
However, United did manage to haul themselves back into the game with 83 minutes on the clock when Goodwillie’s lay-off was collected by Swanson and he drilled a low shot into the back of the net.
But there was further drama to come when Goodwillie snatched the winner deep into injury time. A Buaben free-kick was not cleared properly by the Saints defence and Daly was able to chip back into the box for the substitute to force home.