Souleymane Diawara had cancelled out Robert Lewandowski's early opener but Borussia were heading for the exit until Grosskreutz found the back of the net with a deflected shot three minutes from time.
His goal meant last season's losing finalist finished top of Group F. Arsenal were second, also on 12 points, after losing 2-0 at Napoli who were eliminated. Napoli also finished with 12 but were robbed of a last-16 place by their head-to-head record.
Marseille were down to 10 men from the 34th minute when Dimitri Payet was sent off. They are the first French team to finish the group phase without a point.
"They were very compact but we should have won it 5-0," said Dortmund captain Sebastian Kehl. "We made it tight in the end but hey, it does not matter. It is a big day for us today."
Grosskreutz said: "It was great feeling to score and to score such a goal. We deserved it, it was sensational."
Dortmund were without the injured Sven Bender, Ilkay Gundogan, Neven Subotic, Mats Hummels and Marcel Schmelzer, while Marseille had to deal with the absence of France international Mathieu Valbuena and Ghana striker Andre Ayew.
Centre-back Nicolas N'Koulou and midfielder Alaixys Romao also missed out through suspension and N'Koulou's absence was immediately felt. In the fourth minute, the central defence let Lewandowski power his way into the area to flick the ball past Steve Mandanda after collecting Eric Durm's long pass.
Marseille, though, equalised 10 minutes later when Souleymane Diawara headed the rebound into the empty goal after Saber Khalifa's header from Dimitri Payet's free kick had bounced off the bar. Goalkeeper Roman Weidenfeller completely misjudged the free kick.
The game turned the visitors' way when Payet was sent off 11 minutes before the interval after receiving two yellow cards in quick succession, the second for simulation.
Marco Reus hit the woodwork in the 57th as Borussia piled on the pressure but despite their domination, they failed to score.
Lewandowski inexplicably missed an empty net after dribbling past Mandanda following a Marseille defensive blunder in the 67th, but Grosskreutz's low shot from the edge of the area spared Juergen Klopp's team an embarrassing exit.
- Sports & Recreation
- Robert Lewandowski
- Dimitri Payet
- Souleymane Diawara