Cooper converted from close range to rescue a point for the visitors, who had missed a golden chance to equalise from the spot three minutes from time when Ben Marshall's penalty struck the crossbar - with John Egan having recieved his marching orders for handball.
It looked like being a huge moment for the hosts, who had led thanks to a 51st-minute goal from Gary Madine.
But Cooper had other ideas after netting at the death on an afternoon which saw the Blades lose captain and top-scorer Billy Sharp and Chris Basham to injury.
With the stakes ultra-high at the business end of the season, a tense, nervy first-half ensued with the Blades' cause not helped by the substitution of stalwart defender Basham.
Chris Wilder made an attacking change in introducing Madine to the fray, but it was not the precursor to a significant momentum shift in a largely drab opening half.
The Blades did have a mini-spell of pressure ahead of the interval, but David Martin was largely untroubled in the Millwall goal, with the defenders in front of him protecting the Lions' custodian well.
The Blades' best moment saw David McGoldrick fire a sweet curler just over, while a shot from Enda Stevens - off target with a header earlier in the half - was diverted by a covering defender after a clever interchange.
Millwall's best moment arrived just six minutes in, when the untracked Alex Pearce fired wide after ghosting in at the back post following Shane Ferguson's deep corner.
The Blades upped the tempo on the restart with early blocks from covering defenders denying McGoldrick and Madine - before the latter fired the hosts in front after a quality move.
McGoldrick's pass was latched onto by John Fleck, who showed great awareness and composure to set up Madine, who finished well with a low shot.
The Blades' intesnity was much improved on the restart, but a second goal did not arrive.
Millwall set the tone for a crazy finale when Jed Wallace fired inches over before McGoldrick's cross-shot flew inches wide at the other end.
A fierce free-kick from Mahlon Romeo was then just off the target and Thompson and sub Tom Elliott went close before Egan saw red for handling Elliott's header on the line.
Marshall's penalty shuddered the woodwork, but the Lions continued to press and were rewarded with Cooper's diving header in the fourth minute of stoppage time.
Sheffield United: Henderson, Basham (Madine 21), Egan, O'Connell; Freeman, Fleck, Norwood, Duffy (Coutts 72), Stevens, Sharp (Cranie 64), McGoldrick. Substitutes unused: Dowell, Hogan, Stearman, Moore.
Millwall: Martin, McLaughlin, Pearce, Cooper, Romeo (O'Brien 81); Thompson, Leonard, Tunnicliffe (Elliott 69), Ferguson; Wallace; Gregory. Substitutes unused: Amos, Meredith, Williams, Morison.
Attendance: 26,703 (661 Millwall supporters).