Games Back = (Difference in Wins - Difference in Losses) / 2
So, if Team A is 10-5 and Team B is 8-7, then from the perspective of Team B:
Games Back = (2 - (-2)) / 2 = (2 + 2) / 2 = 2
For your scenario: Team A is 83-71, Team B is 78-65.
Games Back = (5 - 6) / 2 = -1 / 2 = -0.5, meaning Team A is actually 0.5 GB of Team B.
Realistically, GB doesn't really count for anything, it's just a gauge. It is actually possible for a team with a higher winning percentage to be behind another team in terms of Games Back. The team with the higher winning percentage is still technically in 1st place.