This is not a reference to a past event. Let's see the context.
Num 21:16 From there they continued on to Beer, the well where the Lord said to Moses, “Gather the people together and I will give them water.” 17Then Israel sang this song:
“Spring up, O well!
Sing about it,
18about the well that the princes dug,
that the nobles of the people sank—
the nobles with scepters and staffs.”
[they went on] to Beer,
בְּאֵ֑רָה (bə·’ê·rāh)
Noun - proper - feminine singular | third person feminine singular
Strong's Hebrew 876: Beer -- 'well', a place in the desert, also one in Palestine
the well
הַבְּאֵ֗ר (hab·bə·’êr)
Article | Noun - feminine singular
Strong's Hebrew 875: A pit, a well
This is the sequence of happenings: The Lord said to Moses, “Gather the people together and I will give them water.” Moses saw a well and showed it to the people. There was natural water in it. They were excited and sang about it, and named the place Beer, meaning a well.
Gill explains God's telling them this way:
gather the people together, and I will give them water; for as they were now gone from the river Arnon, and the streams and brooks of it, they might be in want of water, though they did not murmur as they had been used to do; and without their petition for it, the Lord promises to give it to them; and that they might be witness of the miracle that would be wrought for them, they are ordered to be gathered together.
(Numbers 21:16) Which well is this?
This was a well that was dug previously by some other people. God led the Israelites to it for the first time.