First of all, one often finds several gaps. Inside the "valence bands" there may occur ionic gaps between (anion) s and p states, gaps between shallow d or f core states and the real s and p valence states and there is finally the "fundamental gap" between occupied ("valence band") and unoccupied ("conduction band") states. And sometimes even in the "conduction bands" gaps might occur in rare cases (for molecular crystals with narrow bands due to the energetic separation of the atomic levels out of which they are formed).
In order to know what is the fundamental gap you need to know the number of electrons in the unit cell. In DOSCAR you have always listed three numbers: energy, density of states, and the integrated density of states (integral from -infinity to energy). So you need to look at the last column with the integrated density of states and where it matches the number of electrons. Is it 40 electrons (about 2.6 eV gap), 64 electrons (about 8.6 eV gap), 160 electrons (about 2.9 eV gap)? The energy range where you find the correct number (along with a density of states of zero in the second column) gives you the gap region. I hope you know at least which gap you have to look for ...
The determination of the energies of the "band edges" (where density of states goes from zero to non-zero) is of course more precise if you take more energy points (parameter NEDOS in INCAR; using values of 10000-50000 is no problem) and if the smearing is extremely small (parameter SIGMA if using Gaussian smearing; most perfect would be the tetrahedron method - any smearing gives a "tail" in the DOS beyond the band edges that actually lowers the apparent gap value by maybe 2-5 times the smearing width).
In particular the coarse energy mesh is a problem in your case. You may take the last/first point with non-zero density of states or with zero density of states. Or the average of these energies. So assuming you have 160 electrons your gap is 2.9 eV +/- 0.1 eV due to the large energy grid spacing of a bit more than 0.1 eV. And so the final precision cannot be larger than (twice) this spacing. If you want to be more precise use a spacing of about 1-5 meV (but keep in mind that the smearing SIGMA should be also fractions of a meV then ... - if your smearing was 0.1 eV the "true" gap could as well be something in the range of 3.1-3.5 eV ...).
Absolutely reliable is only the inspection of the eigenvalues in file EIGENVAL. There you can look at the topmost occupied band and the lowest unoccupied band and try to find the maximum or minimum eigenvalue over all k-points (by that you can also see immediately whether the gap is direct or indirect and at which k-point you find the band extrema - so you obtain more information and more precise information).
Therefore, I prefer to extract gaps from EIGENVAL rather than from DOSCAR! And this is also what I finally recommend to you: look at EIGENVAL, not at DOSCAR. It's harder (and more time-consuming) to find the appropriate information in EIGENVAL (since you have to scan through the eigenvalues at all k-points) but it's precise information. Or use at least NEDOS=20000 (or larger) and SIGMA=1.E-4 (or smaller) if you like to do a quicker job via inspection of DOSCAR.
Step by step process of accurate (both total and projected) DOS and band structure calculations using VASP and some ways of plotting the band structure and DOS of our system is explained in a Youtube video.