Bartra was injured in the bomb blast that led to Dortmund's Champions League quarter-final match against Monaco on Tuesday being postponed, undergoing surgery on a fractured wrist that is expected to sideline him for four weeks.
Sokratis said the victory against Frankfurt will give the team strength as they continue trying to recover from the trauma of the incident
Marco Reus gave Dortmund the lead inside two minutes only for Marco Fabian to equalise just before the half-hour mark, but Sokratis sent a sweetly struck shot into the top-left corner from the edge of the box to restore his side's lead five minutes later.
Pierre-Emerick Aubameyang wrapped up the win with a goal in the 86th minute, but Sokratis' strike was the pick of the bunch.
"The goal was mentally helpful for me, for my psyche, but also very important," he said.
"I think that was actually the most beautiful goal of my career. I dedicate it to Marc Bartra and his family. The two hours of warming up and playing today have helped to switch off a bit, to block everything else out a bit.
"I took a look around and then I just thought I had to go for it myself. Then I don't really remember what I did. I didm't see anything, just that the ball was flying into the goal."
Dortmund travel to Monaco on Wednesday for the second leg of their Champions League tie, trailing 3-2 after the rearranged first leg.
Sokratis described the difficulty he and his team-mates had in focussing on football after the events of the previous week, saying: "It was very hard, not only today.
"It won't be easy in the next games, either. The events of this week are very difficult to forget."