Nicky Clark got his 16th goal of the season in injury time to ensure victory at Palmerston, guiding Sean Murdoch’s long clearance past Queen of the South goalkeeper Lee Robinson, who slipped at the worst possible moment.
Pars manager Johnston said: “The most important thing for us was finishing fifth and now we’re looking to carry this into next season.
“It’s going to be a massive test for us. We’ve a lot of good players and I feel the club is heading in the right direction. We just need that bit more quality.”
Queens had the better chances during a first half which lacked incident. Stephen Dobbie fired a shot on the turn just wide and was then denied by Murdoch.
The home side were frustrated by Murdoch in the second half as he pulled off smart saves to deny Callum Tapping and Dobbie.
And there was to be a sting in the tail for the Doonhamers as Dunfermline won it.
Robinson was left embarrassed as Clark’s touch from a long Murdoch clearance rolled past him after he lost his footing.
Queens manager Gary Naysmith said: “I thought we played really well but the goal has probably summed up our season. The table doesn’t lie and we’ve finished sixth because there have been five teams better than us this season.”