Two papers rejected from conference. One of them was judged based on the other I have recently submitted 2 papers to a top tier IEEE conference; both were rejected.

The reviews for paper B included two accepts and one reject.

However, some of the comments the reviewer who rejected gave us seem to relate to paper A. In fact, he actually named an algorithm appearing in paper A (in his review for paper B), saying its evaluation "is not convincing".

While there's definitely a possibility both options were not good enough, shouldn't they each be judged based on their own merit? Should I mail the PC chair about this?
I think you should mail the chair. It may be to no avail, but the chair will at least be informed of the practice.

Like you, I believe each paper should be judged on its own merits. Don't reject Paper B because you didn't like something in Paper A. That's truly ridiculous. But it could be a new rater who's unfamiliar with the process.