Steps to reproduce
The following dialog always appears:
We couldn't connect to GitLab Enterprise with your (<your_username>) credentials. Check your username and try the password again.
I am encountering this on Sourcetree 4.0 (229) on macOS 10.14.6
As in the comments to this question: there was a set of steps which would resolve this issue in Sourcetree versions prior to circa 3.1.2 (216 or 225) but from that point on the UI changed and it was not possible to follow these steps, or possibly these steps never worked on the Mac Sourcetree application.
In particular, there is now nowhere in the Sourcetree UI where it is possible to load or specify a Private Token once one has been generated in GitLab.
That question is marked as Resolved and thus no further assistance has been provided there, so I am opening a new question to get help with the problem in its current form.