Aitor Karanka's side looked to be in charge after goals from Joe Lolley and Joao Carvalho, either side of a 14-minute break for floodlight failure, had given them a 2-0 lead.
But Shaun Williams pulled one back in the 75th minute with a towering header, before Gregory took advantage of another bit of questionable goalkeeping from Costel Pantilimon to draw Neil Harris' Lions level against his former club.
Millwall should have taken the lead early on when Shane Ferguson found himself with space on the left side and delivered the perfect cross for Gregory to attack at the near post.
But, while the striker connected powerfully with his head, he saw the ball bounce off the bar.
The Lions threatened again when a free-kick was floated into the centre by Jiri Skalak and Tom Elliott saw his downward header well saved by Pantilimon.
Forest's only response, initially, was a low shot fired well wide of goal by Adlene Guedioura and Pantilimon had to save again when Ferguson pounced on a poor punch from the Romanian before firing in a low shot.
The home side threatened properly for the first time when Lolley picked out Ben Osborn on the left with a great ball. Osborn delivered to the near post where Lewis Grabban's flick was narrowly wide.
Two of those players combined again as the Reds took a 27th minute lead. Lolley exchanged passes with Osborn on the edge of the box, with the latter laying the ball off for the former Huddersfield winger to take a touch before finding the bottom corner with a crisp, precise finish.
Pantilimon had to be alert to block another Gregory effort after he pounced on a mistake in the Forest defence.
But Jack Robinson might have done better when a neat, flowing Forest passing move ended with him with the ball at his feet in the box. But he lingered just a little too long before pulling the trigger, and saw his effort charged down for a corner.
The game was delayed for 14 minutes in the second half as the floodlights went out at the City Ground, with referee Jonathan Moss taking the players back into the dressing rooms while the problem was fixed.
Three minutes after play resumed, Forest extended their advantage in spectacular fashion. Ryan Leonard fouled Guedioura a few yards outside the penalty area, earning himself a booking in the process.
Carvalho stepped up to deliver a delicious free-kick that curled into the back of the net off the inside of the post in the 70th minute.
Five minutes later Millwall pulled one back as Ferguson delivered a high, looping cross into the box. Pantilimon came to collect but did not get close as he was beaten to the ball by Williams, who headed into an empty net.
And the visitors' pressure was to tell when they plundered an equaliser in the 90th minute.
Pantilimon struggled to deal with Leonard's low cross-shot at the near post, with the ball looping to the far post where Gregory was arriving to tap home in simple fashion for the equaliser.