Derby defender Richard Keogh became one of only two players - along with Ipswich's Aaron Cresswell - to play every minute in the Championship this season
Derby's win helped them to finish the campaign in 10th place.
Needing to avoid defeat to ensure their second-tier status, the FA Cup semi-finalists put in a nervous display.
Derby came close to taking the lead when an unmarked Richard Keogh will have felt he should have done better than to head Ward's free-kick straight at keeper David Forde.
Liam Trotter blazed a Millwall chance over from 12 yards, before the home side took the lead with five minutes of normal time remaining when Sammon ran on to Ward's through ball.
The goal left Millwall waiting on other results, but Posh's late defeat at Selhurst Park, as well as
Barnsley's 2-2 draw at Huddersfield,
kept Kenny Jackett's side in the Championship.
Millwall assistant manager Joe Gallen:
"The plan was to come here and at least get a point; unfortunately we've relied on other teams.
"It's a great achievement to stay in the division - we're one of the smaller clubs in the Championship. We haven't lost a London derby this season and that's something important to our fans."
Derby manager Nigel Clough:
"Our aim next season is to get four strikers of similar quality if we can, so if it's not quite working for the two playing, we've got options. It's been too much this season; Conor Sammon's had to play 40-odd games.
"We're optimistic - we see what we've got out there now and it's not a team that's going to need breaking up in the next few seasons. We might only have one or two players over 30 going into next season.
"We just need a little bit more experience, we certainly need a centre-half as that's the only two we've got out there today, and we need a centre-forward.
"It's going to be tough again next season; some big teams missed out on the play-offs today and the teams coming up will be decent."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.