That is a tricky question. The USSR struggled to do realistic cost comparisons due to the centrally planned economy and I seem to recall Sukhoi claiming Su-27 was only 15% more expensive than the MiG-29 in a 1989/90 article in an interview in Military Technology magazine. This seems unlikely in retrospect.
In terms of early Su-27 and MiG-29:
In avionics, the radars were roughly equal technically, but the larger antenna on the Su-27 translated to a greater range (100km vs 70km). The Su-27 was supposed to get a much more advanced radar than MiG-29 but technical failures resulted in adoption of components from the less-advanced MiG-29 radar. MiG-29 was initially supposed to get an improved version of the MiG-23's Sapfir-23 radar, but later on got a more advanced radar, so they kind of met in the middle a bit.
The Su-27 had a superior IRST primarily due to improved cooling, giving longer range.
The Su-27 had the TKS-2 and Spectr-1 datalink, which allowed Su-27s to perform group actions and exchange target information. The MiG-29 just had a standard Biriyuza datalink receiver for receiving data from GCI control.
The Su-27 had the Sorbtsiya ECM suite in external wingtip pods, which was the most capable ECM system the USSR could field, though it took a while to operationalise. The MiG-29 (9.12) had no ECM capability, while the humpback 9.13 added an internal Gardeniya jammer of questionable utility.
The Su-27 was supposed to get a two-colour HUD and large circular CRT, then a three-colour CRT, but in the interests of standardisation, cost and speed adopted the lower-cost, lighter monochrome HUD and CRTs from the MiG-29.
The RWR on each was identical (SPO-15 Beryoza).
In terms of weapons the gun was identical, the Su-27 could carry 10 AAMs including 6 medium-range R-27 missiles, with the MiG-29 only carrying 6 AAMs including 2 R-27 medium-range missiles.
Initially, the Su-27 was supposed to use R-33 AAMs from the MiG-31, but this required the advanced radar with electronic scanning which was abandoned. The enlarged R-27E missile was developed instead to exploit the extra range of the Su-27's radar.