We need a lot more information about the sensor or the sensor circuit or the sensor signal before there can be a detailed answer. But ...
A digital signal on only two wires cannot be converted to an analog signal with a D/A converter unless the digital signal actually is a serial data word of some bit length. If it is, there are some D/A converter chips that are designed for certain specific serial data formats. Or, you can grow one from scratch with a serial-to-parallel converter followed by a parallel input D/A. Both of these are difficult designs for a novice.
If it is a simple square wave, then the next question is how simple? How does the signal vary when whatever the (secret) sensor is sensing changes?
If the frequency changes but the duty cycle (percentage of time spent high and low) stays approximately constant, that is an FM signal and can be converted to an analog signal with any one of several types of FM demodulators or frequency-to-voltage converter circuits.
If the frequency stays relatively constant but the duty cycle changes, that is called pulse-width modulation, or PWM. This can be converted to an analog signal with a lowpass filter.
There are other possibilities, but those are two of the most common. Overall, what you want to do certainly can be done. The complexity involved depends on the true nature of the sensor and its signal.