Gregory’s first-half double, the second from the penalty spot, had the home fans dreaming, though Tom Ince’s fine free-kick gave Derby a crumb of comfort.
Another Gregory penalty moments after the break should have ended the argument but Derby, with a play-off place on the line, kept fighting, Ince winning a penalty for Chris Martin to convert.
And a wonder volley five minutes from time from Hendrick saw the points shared, with Millwall now needing to win at Wolves on the final day and hope for other results to go their way.
Both sides started at a high tempo, with Millwall’s urgency too often straying into the overly physical, and the visitors were far more fluent with the ball.
The first real chance though, fell to the hosts as Aiden O’Brien surged clear but shot tamely when he had Jimmy Abdou free to his right.
Derby were struggling for identity, torn between the pretty patterns of their midfield and playing direct to Conor Sammon up front, and their indecision showed as they fell behind after 26 minutes.
In truth it was an absolute horror show for Derby keeper Lee Grant as his sliced clearance found Gregory who gratefully ran unopposed into the box and finished well.
Shortly after, a strong burst down the left flank from Lee Martin saw Derby captain Richard Keogh handle in the box and Gregory calmly converted the penalty.
Derby were rattled, but a cheap free-kick on the edge of the Millwall area allowed Ince to curl a left-footed beauty over the wall and send the visitors into the dressing room on a high note.
A needless corner conceded by Derby became a needless penalty as Hendrick was lucky to escape with a booking after seemingly elbowing Nicky Bailey.
Again it was Gregory who stepped up, firing low into the bottom-right corner to complete his hat-trick.
Millwall struggled to shut up shop, however, Ince finding joy down the right flank and first Johnny Russell then Simon Dawkins threatening the target.
Ince’s surging run in the 70th minute saw him needlessly felled in the box by O’Brien and Martin – on his return from injury, slotted home for his 18th league goal this season.
And a breathtaking late equaliser followed for Derby as Ince pulled the ball back for an audacious right-footed volley from Hendrick into the top corner.
Neil Harris’ team kept pushing for a winner they would have clearly deserved as Ricardo Fuller was brought down legally in the box before Ince almost stole it for the Rams at the other end deep into injury time.