Can you make Lt. Commander without interacting and working with the crew?
I highly doubt it, but interacting with his coworkers & socializing on the level he did aboard the D might have been two very different things for him. Following orders efficiently, & distinguishing himself in his post might have gone a long way to move him up the ranks if he had the right commanding officers, at least a couple times anyway to get him past Lt. Junior Grade & Lieutenant
I don't think anything was ever mentioned about Data's rank just prior to being posted to the Enterprise. It's possible he was promoted to Lt. Cmdr when he was assigned to the D, & that the biggest jump in his entire career was wholly due to Picard, who fostered almost every officer under him on that ship, & took big leaps of faith with them as well
Let us also not forget the occasions where he earned those 4 medals we hear mentioned in
The Measure of a Man, all of which recognize gallantry, bravery, & excellence in action. We ourselves have seen multiple occasions where just having Data onboard has saved the ship & crew from being lost. Perhaps there were a couple of those kinds of situations in his earlier career as well, which not only wound up getting him medals, but also promotions, perhaps even catching Picard's eye & lining him up for the 3rd seat on the D
Maybe it wasn't so much Data being physically isolated, but emotionally isolated, either by his own behavior or by others' towards him.
I sort of view it like this myself too. The D crew were maybe the first people to treat him not only like an actual person, but a friend. It was his friendship with them that really expanded his social growth. The crew were always very open to him as a person, where that might not have been the case for him in years prior