Osmajić scored in the 12th minute to equalize. Ben Wightman crossed, and the Nikšić native eluded the defenders and headed the ball into the net from the penalty area.
This is the seventh league goal of the season for the former Sutjeska striker.
The visitors took the lead in the fifth minute through Michal Helik. Will Lancashire made it 2:1 in the 55th minute, and Kieron Brown set the final score six minutes later.
Another Montenegrin national team player, Andrija Vukčević, was substituted midway through the second half.
Preston is in crisis – they have not won in their last five matches and are currently 12th in the table with 49 points, eight points less (with a match more) than Wrexham, who are in the play-off zone.