The Blades led 3-0 but conceded two goals in four minutes to set up a tense finish at Oakwell
The Blades swept into a 3-0 lead with a second-half double from Lys Mousset and a third from Ben Osborn 18 minutes from time.
But Barnsley substitutes Devante Cole and Aaron Leya Iseka struck inside four minutes to give the home side hope and leave the Blades to negotiate a tricky final eight minutes at Oakwell.
That late lapse left Jokanovic with mixed feelings about the win.
“In the last 10 minutes or so, what happened is not acceptable,” he said. “We started to panic and we started thinking we cannot win the game.
“In this kind of moment, you need to be calm and try to finish the game in a better shape. We won a local derby in front of a lot of our supporters and in this part I am happy, but it was a really hard 10 minutes for us.
“We gave them oxygen for them to find something positive and in football that is not acceptable.
“I am happy with the three points but if you don’t improve this kind of the game, it can be really, really expensive for us.”
Jokanovic was also unhappy with the Blades’ first-half showing when they struggled to create chances.
“For the first 45 minutes, we didn’t find enough spaces and didn’t find enough quality,” he said. “In the second half we found more spaces and we scored three early goals and we could have scored more goals.”
Barnsley head coach Markus Schopp drew consolation from the manner in which his side clawed their way back into the contest.
Devante Cole pulled a goal back on 78 minutes with a thumping shot to give Barnsley hope and Aaron Leya Iseka raised hopes of salvaging a point when he forced his way through in the area before firing past Olsen in the 82nd minute.
Schopp said: “The reaction after the three-zero was awesome. It is positive.
“It’s a tough one to have a derby and be down three-zero. In games like this, it’s so important which team makes the first error and we made two in a couple of minutes.
“This is not the first time – it’s an ongoing story that we get beaten too easy. It’s again a defeat which is totally unnecessary.
“It’s never easy and I know I am responsible for the situation. I try to find a solution. It’s not good enough. It is a tough situation for all of us. I will do everything to prepare the lads in the best possible way for the next game.”
Mousset opened the scoring in the 51st minute , finishing from the edge of the area after cutting inside.
The Frenchman struck again two minutes later, firing Osborn’s cross into the roof of the net from close range.
Osborn made it 3-0 on 72 minutes when he steered George Baldock’s cross beyond Brad Collins.