The Lions, relegated from the Championship last season, had the better of the first half with Jayson Leutwiler the busier of the two goalkeepers.
He had to be alert to turn away a powerful 35-yard free-kick from Shaun Williams before diving full length to his left to tip a low drive from the lively Fred Onyedinma round a post.
Then when Leutwiler was beaten, midfielder Abu Ogogo was on hand to nod a looping header from Millwall full-back Mark Beevers off the line.
Shrewsbury found chances hard to come by although Tyrone Barnett and Jean-Louis Akpa Akpro were both off target with headers.
The hosts took the lead from a well worked free-kick nine minutes into the second half. Ryan Woods floated the ball into the box and Jean-Louis Akpa Akpro smashed it across the face of goal for James Collins to fire in from a tight angle at the far post.
Millwall were level within five minutes as Onyedinma tricked his way into the box from the left and crossed for Steve Morison to tap home at the far post.
Then came the decisive moment to settle the game in the 67th minute when Morison was caught by Mat Sadler and Gregory did the rest from the penalty spot to secure maximum points for the Lions.