Do I need equally paced values to do a Fourier Cosine Transform?
All standard transforms in DSP (including Fourier transforms or Cosine transforms etc.) assume uniformly sampled (time, space or frequency) input data.

When your data is nonuniformly sampled, you cannot directly use the standard algorithms. 

You should either convert them into uniform samples and then use the standard algorithms or use specific algorithms that work on nonuniform data directly.

For the conversion, look for non-uniform to uniform interpolators.