Triangulation does not require being able to determine distance. Here is an example on an earth-bound maritime navigational chart:
The ship in this situation would need to know in advance that it is somewhere off the west side of Cayo Santiago. After that, it just uses compass bearings to the north tip, the south tip, and what appears to be a water tank on the mainland. Draw those three lines on your chart, and there you are (literally).
In interstellar space, we will need a different reference point than magnetic north. What we probably will do instead is take relative angles between multiple stars, like this:
If the angle between this star and that star is 45° then we are probably the upper space ship. If it is more like 30° then we are the bottom space ship. Again, we don't need to know how far we are from those stars, only the angles. Of course, we are doing this in three dimensions, so we will need a couple more stars to get our position fix.
We will need to have an accurate 3-D model of the precise locations of stars, similar to how the boater needs a carefully surveyed chart of the waters he is in. Fortunately, we can get a decently good idea of that before we leave. This is done by noting the tiny difference between where a star appears to be from Earth versus half-a-year later, a concept known as stellar parallax (in some ways the reverse of triangulation.)